Parser: an attribute or doc comment in front of a `{...` spread type changes how it is read
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- ocaml
- 領域
- compilers
調査の方向性
Start by reading the lookahead in res_core.ml and the referenced context in #9115, which keeps the current behaviors. Reproduce the table with bsc -bs-no-builtin-ppx -only-parse -dparsetree to trace how prefixes affect {... classification. Done means prefixes no longer change the classification, both reported syntax errors are fixed, and the compatibility change has a changelog entry.
索引モデルが issue の本文から書いたものです。
説明
A type body starting with {... can be a record spread or an object spread. Without a prefix, the parser reads it as a record unless a quoted field follows. With an attribute or a doc comment in front, it takes a different path, so the prefix changes what the declaration means or makes it a syntax error.
Checked on master at 85f31fbb15 with bsc -bs-no-builtin-ppx -only-parse -dparsetree:
type t = … |
no prefix | @attr |
/** d */ |
|---|---|---|---|
{...base, y: int} |
record | syntax error | record |
{...base} |
record | object type | record |
{...base, "y": int} |
object type | object type | syntax error |
The same holds after private, e.g. type t = private @attr {...base, y: int} is a syntax error.
Cause: after an attribute, the lookahead in res_core.ml treats {... as the start of a type expression (object type); after a doc comment, the record path is taken unconditionally. #9115 (for #9106) keeps both behaviours as they are, so nothing master accepts changes there.
Expected: the prefix doesn't matter, and {... is classified as without one. That fixes both syntax errors, but it also turns @attr {...base} from an object type into a record, which changes code that compiles today, so it needs a changelog entry.
🤖 Generated with Claude Code
- 主要言語
- OCaml
- スター
- 7.5k
- フォーク
- 484
- 平均マージ
- 20時間 43分
- マージ済み PR(30日)
- 263
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rescript-lang/rescript のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
rescript-lang/rescript#9139 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
rescript-lang/rescript#9151 ·
メンテナーはふだん 1 日以内に返信
-
Printed @as names of fields and constructors turn non-ASCII letters into other characters対応中かも @cknitt が今日担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
rescript-lang/rescript#9142 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
rescript-lang/rescript#9130 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Dev dependencies interacting対応中かも @CarlOlson が 4 日前に担当しました。 オープン
難易度 4/5 1〜2日 初心者へのやさしさ 25/100
rescript-lang/rescript#9089 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
rescript-lang/rescript の issue をすべて見る
似ている issue
-
bot-triaged module: inductor oncall: pt2 topic: fuzzer triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
microsoft/DirectXShaderCompiler#9087 ·
メンテナーはふだん 1 日以内に返信
-
confirmed generated by fuzzer llvm:codegen miscompilation
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
llvm/llvm-project#237380 ·
メンテナーはふだん 1 日以内に返信
-
area:observer area:trace-tape found-by:code-review kind:docs-drift
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
InauguralSystems/EigenScript#2212 ·
メンテナーはふだん 1 日以内に返信
-
bug medium priority openmp tokenizer wrong result
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信