Skip to content

Conversation

@shulhi
Copy link
Member

@shulhi shulhi commented Jan 7, 2026

Fix #8154

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 7, 2026

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript-lang/rescript@8155

@rescript/darwin-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-arm64@8155

@rescript/darwin-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-x64@8155

@rescript/linux-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-arm64@8155

@rescript/linux-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-x64@8155

@rescript/runtime

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/runtime@8155

@rescript/win32-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/win32-x64@8155

commit: 799de70

@shulhi shulhi marked this pull request as ready for review January 9, 2026 09:48
@shulhi shulhi requested a review from cknitt January 10, 2026 12:08
@cknitt
Copy link
Member

cknitt commented Jan 11, 2026

@codex review

@chatgpt-codex-connector
Copy link

To use Codex here, create a Codex account and connect to github.

@cknitt
Copy link
Member

cknitt commented Jan 11, 2026

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e77f67f950

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 5919 to 5924
let tag_with_doc =
match tag with
| Parsetree.Rtag (name, attrs, contains_constant, types) ->
Parsetree.Rtag
(name, doc_comment_attrs @ attrs, contains_constant, types)
| Rinherit _ -> tag

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve doc comments on inherited row fields

When a doc comment appears before a | that introduces an inherited row field (e.g., /** doc */ | Some.t), parse_tag_specs now accepts the comment but drops it because it only prepends doc_comment_attrs for Rtag and ignores Rinherit. That means the new syntax silently loses documentation in the AST and formatter. If doc comments are meant to attach to all polyvariant entries, you’ll want to carry doc_comment_attrs into the Rinherit case (e.g., by adding them to typ.ptyp_attributes or threading them into parse_tag_spec).

Useful? React with 👍 / 👎.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codex can you give a concrete example of the above issue?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cknitt
Copy link
Member

cknitt commented Jan 11, 2026

@shulhi Could you address the comment from Codex?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Doc comments removed for poly variant

2 participants