Check for undefined source.symbol when elaborating unmatched properties#37021
Merged
RyanCavanaugh merged 1 commit intomicrosoft:masterfrom Feb 25, 2020
Merged
Check for undefined source.symbol when elaborating unmatched properties#37021RyanCavanaugh merged 1 commit intomicrosoft:masterfrom
source.symbol when elaborating unmatched properties#37021RyanCavanaugh merged 1 commit intomicrosoft:masterfrom
Conversation
d8ce7d7 to
864c2d4
Compare
DanielRosenwasser
approved these changes
Feb 25, 2020
weswigham
approved these changes
Feb 25, 2020
Member
Author
|
@typescript-bot cherry-pick this to release-3.8 |
Collaborator
|
Heya @RyanCavanaugh, I've started to run the task to cherry-pick this into |
typescript-bot
pushed a commit
to typescript-bot/TypeScript
that referenced
this pull request
Feb 25, 2020
Component commits: 864c2d4 Check for undefined `source.symbol` Fixes microsoft#37014
Collaborator
|
Hey @RyanCavanaugh, I've opened #37025 for you. |
a-tarasyuk
reviewed
Feb 26, 2020
| if (unmatchedProperty.valueDeclaration | ||
| && isNamedDeclaration(unmatchedProperty.valueDeclaration) | ||
| && isPrivateIdentifier(unmatchedProperty.valueDeclaration.name) | ||
| && source.symbol |
Contributor
There was a problem hiding this comment.
source uses the type Type. Based on the Type definition property symbol cannot be undefined.
TypeScript/src/compiler/types.ts
Line 4365 in 56b6d0d
Are there are other cases when symbol can be undefined? Maybe make sense to change type definition from symbol: Symbol; to symbol: Symbol | undefined in order to avoid such bugs?
What do you @DanielRosenwasser @RyanCavanaugh @weswigham think?
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 #37014