Fix crash in declaration emit with nested binding patterns#63154
Merged
DanielRosenwasser merged 3 commits intomainfrom Feb 18, 2026
Merged
Fix crash in declaration emit with nested binding patterns#63154DanielRosenwasser merged 3 commits intomainfrom
DanielRosenwasser merged 3 commits intomainfrom
Conversation
- Added continue statement when walking nested binding patterns - Added comprehensive test cases covering various nested binding patterns Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com>
Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix crash for declaration emit with nested binding pattern
Fix crash in declaration emit with nested binding patterns
Feb 17, 2026
DanielRosenwasser
approved these changes
Feb 18, 2026
9 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a crash in the declaration emit transformer when encountering nested binding patterns inside (invalid-but-emitted) parameter properties, ensuring the emitter no longer attempts to treat a BindingPattern as an Identifier.
Changes:
- Adjust
walkBindingPatterntocontinueafter recursively processing nested binding patterns, preventing incorrect identifier handling. - Add a compiler test covering nested array/object/mixed binding patterns in parameter properties and capture new baselines.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/compiler/transformers/declarations.ts | Prevents crash in parameter-property declaration emit by skipping identifier path for nested binding patterns. |
| tests/cases/compiler/declarationEmitNestedBindingPattern.ts | Adds regression coverage for multiple nested binding pattern shapes/levels. |
| tests/baselines/reference/declarationEmitNestedBindingPattern.* | Baselines validating no crash and stable emit/type/symbol/error outputs. |
jakebailey
approved these changes
Feb 18, 2026
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.
Fixes crash when emitting declarations for parameter properties with nested binding patterns:
Root cause:
walkBindingPatternrecursively processed nested patterns but continued execution, attempting to use the binding pattern as anIdentifier, causingCannot read properties of undefined (reading 'id').Fix: Add
continueafter recursive call to skip identifier handling for nested patterns.Changes:
src/compiler/transformers/declarations.ts: Add continue statement in walkBindingPattern when encountering nested binding patternstests/cases/compiler/declarationEmitNestedBindingPattern.ts: Add test coverage for various nested binding pattern scenarios (array, object, mixed, multiple levels)Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.