Fix nil pointer dereference in addPropertyToElementList#3361
Draft
Fix nil pointer dereference in addPropertyToElementList#3361
Conversation
Prevents nil pointer dereference when accessor property symbols have nil parent (e.g. synthetic union/intersection properties). This matches the existing nil-check pattern used in checker.go and utilities.go. Agent-Logs-Url: https://github.com/microsoft/typescript-go/sessions/9dbc6324-847e-4f7d-a3ba-c6062af308cf Co-authored-by: DanielRosenwasser <972891+DanielRosenwasser@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix nil pointer dereference in NodeBuilderImpl.addPropertyToElementList
Fix nil pointer dereference in addPropertyToElementList
Apr 7, 2026
DanielRosenwasser
requested changes
Apr 7, 2026
Member
DanielRosenwasser
left a comment
There was a problem hiding this comment.
The test case doesn't seem to fail locally. Back out the changes to nodebuilderimpl, validate that it actually crashes. If it does, it is probably because of the way type/symbol baselines are generated, so find a way to turn the test case into a declaration emit test.
Member
|
@copilot go. |
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.
propertySymbol.Parentcan be nil for synthetic union/intersection property symbols (created bycreateUnionOrIntersectionPropertywhen value declarations differ across constituents). Accessing.Flagson it crashes during declaration emit.propertySymbol.Parentbefore accessing.Flagson lines 2321 and 2346 ofnodebuilderimpl.gochecker.go:11519andutilities.go:707:declarationEmitAccessorNilParent.tsexercising accessor property declaration emit