Skip to content

allow private in with constraints#301

Merged
aspeddro merged 1 commit into
rescript-lang:mainfrom
aspeddro:fix-298
Jul 12, 2026
Merged

allow private in with constraints#301
aspeddro merged 1 commit into
rescript-lang:mainfrom
aspeddro:fix-298

Conversation

@aspeddro

Copy link
Copy Markdown
Collaborator

Close #298

@aspeddro
aspeddro merged commit b6df41d into rescript-lang:main Jul 12, 2026
3 checks passed

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

Copy link
Copy Markdown

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: 55353c1b21

ℹ️ 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 thread grammar.js
),

constrain_type: ($) => seq("type", $._type, choice("=", ":="), $._type),
constrain_type: ($) => seq("type", $._type, choice("=", ":="), optional("private"), $._type),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restrict private to = constraints

Because optional("private") is placed after choice("=", ":="), this also accepts destructive substitutions like S with type t := private int. The := form takes a plain replacement type and should not carry the privacy marker that belongs to equality constraints such as with type t = private ..., so tree-sitter consumers now treat compiler-invalid signatures as valid. Split the alternatives so private is only allowed on the = branch.

Useful? React with 👍 / 👎.

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.

allow private in with constraints

1 participant