Formatter prints @res.doc on a function parameter as a doc comment that does not parse
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- ocaml
- 領域
- compilers
調査の方向性
Start by tracing bsc -format from the formatter path that prints @res.doc on function parameters; compare it with how @ocaml.doc and @ns.doc are preserved, and inspect the parser around parameter doc comments. The issue permits either keeping the attribute form in formatter output or accepting the comment in the parser. Done means the shown input formats to output that parses successfully when formatted again.
索引モデルが issue の本文から書いたものです。
説明
The formatter prints a @res.doc attribute on a function parameter as a doc comment in front of the parameter, and the parser rejects that output.
let f = (@res.doc("The runner") run: string) => run
bsc -format prints:
let f = (
/**The runner*/
run: string,
) => run
Formatting that output again fails:
Syntax error!
2 │ /**The runner*/
3 │ run: string,
I'm not sure what to parse here when looking at "DocComment The runner".
So formatting turns a file that compiles into one that doesn't. @ocaml.doc/@ns.doc on a parameter have been formatted unchanged, because the printer prints only res.doc as a doc comment. If #8992 lands, @res.doc is the only doc attribute left, so writing it by hand on a parameter hits this. genType's tests/gentype_tests/typescript-react-example/src/Comments.res keeps @ocaml.doc on two parameters for this reason.
Either the printer keeps the attribute form for parameters, or the parser accepts a doc comment before a parameter.
Found while working on #8978.
🤖 Generated with Claude Code
- 主要言語
- OCaml
- スター
- 7.5k
- フォーク
- 483
- 平均マージ
- 21時間 8分
- マージ済み PR(30日)
- 183
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rescript-lang/rescript のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
rescript-lang/rescript#8996 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 70/100
rescript-lang/rescript#8997 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 1〜2日 初心者へのやさしさ 55/100
rescript-lang/rescript#8995 ·
メンテナーはふだん 1 日以内に返信
-
Issues from differential semantic drift analysis (a7721303 to b123b7c3)対応中かも @cknitt が今日担当しました。 オープン
rescript-lang/rescript#8980 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Doc-comment attributes: editor analysis accepts `@ocaml.doc`/`@ns.doc`, genType and the printer do not対応中かも @cknitt が今日担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
rescript-lang/rescript#8978 ·
メンテナーはふだん 1 日以内に返信
rescript-lang/rescript の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
objectionary/phino#2075 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
bug P2
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
duplicate
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
numba/numba#10939 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信