Parser rejects `private @attr {…}` and a doc comment before a non-record type
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- ocaml
- 領域
- compilers
調査の方向性
Start in compiler/syntax/src/res_core.ml at parse_private_eq_or_repr and the type representation dispatch around the cited lines. Trace how private attributes and DocComment tokens reach parse_typ_expr or parse_type_representation, then check nearby parser tests for the corresponding syntax cases. Done means both examples and the listed related type forms parse without changing existing cases; pull request #9115 is already open.
索引モデルが issue の本文から書いたものです。
説明
Found by a bug hunt over the 16 commits from eb087382 to cd641cbc.
private followed by an attribute and a record.
type t = private @attr {x: int}
This fails with "An inline record type declaration is only allowed in a variant constructor's declaration or nested inside of a record type declaration". type t = @attr {x: int} (#8919) and type u = private {x: int} both parse. At counts as the start of a type expression (res_grammar.ml#L205), so parse_private_eq_or_repr parses @attr {x: int} with parse_typ_expr (res_core.ml#L5802-L5803). The non-private path has its own At lookahead (res_core.ml#L6043).
A doc comment after = in front of a non-record type.
type z = /** d */ int
This fails with "Did you mean Int instead of int?". {"a": int}, (int, int) and [#A] fail the same way. /** d */ {x: int}, /** d */ A | B and @attr int parse. res_core.ml#L6037 sends DocComment straight to parse_type_representation. The At case at the next arm looks ahead for objects and manifests first.
Both reproduce at b123b7c3.
🤖 Generated with Claude Code
- 主要言語
- OCaml
- スター
- 7.5k
- フォーク
- 484
- 平均マージ
- 20時間 19分
- マージ済み PR(30日)
- 242
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rescript-lang/rescript のほかの issue
-
Record coercion can construct a private record from outside its module対応中かも @cknitt が今日担当しました。 オープン
難易度 4/5 1〜2日 初心者へのやさしさ 52/100
rescript-lang/rescript#9124 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 56/100
rescript-lang/rescript#9123 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 1〜2日 初心者へのやさしさ 55/100
rescript-lang/rescript#9122 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
rescript-lang/rescript#9109 ·
メンテナーはふだん 1 日以内に返信
-
Formatter: five cases where comments and doc comments are placed wrongly対応中かも @cknitt が 1 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
rescript-lang/rescript#9107 ·
メンテナーはふだん 1 日以内に返信
rescript-lang/rescript の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
CanadaHonk/porffor#426 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信
-
[MLIR][TOSA] Assertion in verifyBlockScaledTensorType when a tosa op result type is not a tensorオープンcrash mlir:tosa
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
llvm/llvm-project#236561 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Lexer: Turbopack magic comments are not classified対応中かも @Aschenbath が今日担当しました。 オープンA-lexer
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
oxc-project/oxc#28320 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[python] Python library model: str(None) is modelled as an unconstrained string instead of "None"オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信