Skip to content

Fix errors from test wild - #294

Merged
aspeddro merged 6 commits into
rescript-lang:mainfrom
aspeddro:fix-errors-from-test-wild
Jul 11, 2026
Merged

aspeddro merged 6 commits into
rescript-lang:mainfrom
aspeddro:fix-errors-from-test-wild

Conversation

@aspeddro

@aspeddro aspeddro commented Jul 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • support source-typed coercions such as (value: sourceType :> targetType)
  • support type annotations after labeled parameter defaults, such as ~chain=#1: chainId
  • allow chained member access to begin on the next line
  • preserve variant declarations when block comments appear between constructors
  • prevent identifiers beginning with with, such as withExhaustiveCheck, from being mistaken for the with keyword
  • add corpus coverage for each regression and regenerate parser artifacts

Close #293

aspeddro added 4 commits July 11, 2026 01:17
- Source-typed coercions such as `(value: sourceType :> targetType)`.
- Method chains beginning with `.` on the next line.
- Post-default parameter annotations such as `~chain=#1: chainId`.
The issue was a block comment between variant constructors:

```rescript
| ThrowsMatchSnapshot(unit => _): assertion
/* JS */
| Defined(...)
```

The significant newline before the comment prematurely ended
`variant_type`. The variant separator now accepts these newlines and
uses a local GLR conflict to distinguish declaration termination from
additional constructors
The scanner treated any identifier beginning with `with` as the
module-constraint keyword. Consequently, the newline before
`withExhaustiveCheck` was suppressed and two mutations were merged.

scanner.c now requires whitespace after `with`, confirming it is a
standalone keyword. Added regression coverage in expressions.txt

@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: 8433765a3d

ℹ️ 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 src/scanner.c
Comment thread scripts/test_wild.mjs
@aspeddro
aspeddro merged commit ae672d6 into rescript-lang:main Jul 11, 2026
3 checks passed
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.

Errors from enviodev/hyperindex

1 participant