feat(parser): add ts error 1265 for TSTupleElement#18144
feat(parser): add ts error 1265 for TSTupleElement#18144graphite-app[bot] merged 1 commit intomainfrom
TSTupleElement#18144Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
6080dfe to
5360a0b
Compare
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
Footnotes
|
There was a problem hiding this comment.
Pull request overview
This PR adds support for TypeScript error 1265, which detects when a rest element follows another rest element in tuple types. The implementation correctly identifies cases where two array-type rest elements appear consecutively in a tuple definition (e.g., [...string[], ...boolean[]]), which is invalid TypeScript syntax.
Changes:
- Added error detection for consecutive rest elements with array types in tuple types
- Updated the
parse_delimited_listfunction signature to acceptFnMutclosures instead ofFn - Added new diagnostic function
rest_element_cannot_follow_another_rest_elementfor TS error 1265
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tasks/coverage/snapshots/parser_typescript.snap | Updated test coverage showing one additional negative test passing; removed the variadicTuples2.ts from expected syntax errors and added specific TS(1265) error messages |
| crates/oxc_parser/src/ts/types.rs | Implemented logic to track and detect consecutive rest elements with array types in tuple parsing, emitting TS error 1265 when appropriate |
| crates/oxc_parser/src/diagnostics.rs | Added rest_element_cannot_follow_another_rest_element diagnostic function and reorganized const_class_member function for better ordering |
| crates/oxc_parser/src/cursor.rs | Changed parse_delimited_list signature from Fn to FnMut to support closures that mutate captured state |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5360a0b to
08c3274
Compare
08c3274 to
f8f59ce
Compare
f8f59ce to
0f4f7da
Compare
Merge activity
|
0f4f7da to
349c886
Compare
349c886 to
acf1aba
Compare

https://www.typescriptlang.org/play/?#code/LAKALgngDgpgBAQQDwBU4wB5hgOwCYDOcArjgNY4D2A7jgNoC6AfHALxx0FgBOAljgHMANHAB04rn0GMR40SkYNQoSLDgAhVOiy5CJclVqMW7Tj37CxE89IazxCu1dGSLigNzLw0eAGEtmNj4RKQUNPTMbBxyrrb28gyeICo+cAAiATrB+mFGkaYxNpZyKIleqvAAoplBeqGGESbR1lICMs6OZSBAA