Add support for v12 nested types#264
Merged
nojaf merged 1 commit intorescript-lang:mainfrom Jan 19, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds support for ReScript v12 nested record types, allowing record type syntax to be used inline within generic type arguments, function type parameters, and other type contexts where previously only named types could be used.
Changes:
- Added
record_typeto_non_function_inline_typegrammar rule to enable nesting - Added a new precedence conflict rule between
_typeand_non_function_inline_type - Added comprehensive test cases demonstrating nested record types in various contexts
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| grammar.js | Added record_type to _non_function_inline_type choice and new conflict rule for disambiguation |
| src/grammar.json | Generated grammar file reflecting the grammar.js changes |
| src/node-types.json | Updated node type definitions to include record_type in function_type_parameters, polymorphic_type, polyvar_declaration, type_annotation, and type_binding children |
| test/corpus/type_declarations.txt | Added three test cases covering nested records in different contexts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For example