Exception analysis does not know the Temporal `fromStringOrThrow` functions

オープン 初心者向け
#9,182 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@cknitt がすでに取り組んでいます。

2026年11月3日 から。

  • #9198 @cknitt による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
ocaml
領域
devtools

調査の方向性

例外を投げる関数の一覧は analysis/reanalyze/src/exn_lib.ml の 114〜190 行付近にあり、issue では #9094 で追加された Temporal の external 8 件 fromStringOrThrow がそこに欠けていると指摘されています。まず既存の *OrThrow エントリがどのように書かれているかを読み、次に issue の 3 行のスニペットに対して rescript-tools reanalyze -exception を実行してください。3 つの Temporal 呼び出しすべてが JsExn を投げるものとして報告されれば完了です。big だけでは不十分です。

索引モデルが issue の本文から書いたものです。

説明

Found by differential semantic drift analysis from b123b7c3 to c10223e8.

What is broken

let big = () => BigInt.fromStringOrThrow("x")
let date = () => Temporal.PlainDate.fromStringOrThrow("x")
let dur = () => Temporal.Duration.fromStringOrThrow("x")

rescript-tools reanalyze -exception reports only big might throw JsExn. #9094 added eight fromStringOrThrow externals (Duration, Instant, PlainDate, PlainDateTime, PlainMonthDay, PlainTime, PlainYearMonth, ZonedDateTime); none is in the table of throwing library functions in exn_lib.ml, which lists every other stdlib *OrThrow function.

Temporal functions that throw without the OrThrow suffix (arithmetic out of range, invalid arguments to constructors) were not checked.

Possible cause (speculation only)

The table is maintained by hand next to the stdlib, and nothing checks that a new *OrThrow external has an entry.

🤖 Generated with Claude Code

主要言語
OCaml
スター
7.5k
フォーク
484
平均マージ
16時間 57分
マージ済み PR(30日)
258

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

rescript-lang/rescript のほかの issue

rescript-lang/rescript の issue をすべて見る

似ている issue

DevTools の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。