Skip to content

Fix module_unpack to allow type annotation on call expressions#270

Merged
aspeddro merged 1 commit intorescript-lang:mainfrom
aspeddro:fix/module-unpack-call-type-annotation
Apr 22, 2026
Merged

Fix module_unpack to allow type annotation on call expressions#270
aspeddro merged 1 commit intorescript-lang:mainfrom
aspeddro:fix/module-unpack-call-type-annotation

Conversation

@aspeddro
Copy link
Copy Markdown
Collaborator

Summary

  • module_unpack failed to parse unpack(make(): T) — the : T type annotation after a call expression was producing an ERROR node
  • Fixed by wrapping call_expression in a seq with optional(module_type_annotation) in grammar.js
  • Added two corpus tests covering unpack(expr(): T) and unpack(expr(): T with type t = int)

Test plan

  • npx tree-sitter test — all 142 tests pass
  • npm run parse test_wild/issue_251.res — parses without errors

🤖 Generated with Claude Code

Adds optional `module_type_annotation` after `call_expression` inside
`module_unpack`, so `unpack(make(): T)` parses correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@aspeddro
Copy link
Copy Markdown
Collaborator Author

Close #251

@aspeddro aspeddro requested a review from nojaf April 21, 2026 22:08
@aspeddro aspeddro merged commit 3184459 into rescript-lang:main Apr 22, 2026
1 check 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.

2 participants