-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check for undefined source.symbol
when elaborating unmatched properties
#37021
Conversation
d8ce7d7
to
864c2d4
Compare
@typescript-bot cherry-pick this to release-3.8 |
Heya @RyanCavanaugh, I've started to run the task to cherry-pick this into |
Component commits: 864c2d4 Check for undefined `source.symbol` Fixes microsoft#37014
Hey @RyanCavanaugh, I've opened #37025 for you. |
@@ -16239,6 +16239,7 @@ namespace ts { | |||
if (unmatchedProperty.valueDeclaration | |||
&& isNamedDeclaration(unmatchedProperty.valueDeclaration) | |||
&& isPrivateIdentifier(unmatchedProperty.valueDeclaration.name) | |||
&& source.symbol |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
source
uses the type Type
. Based on the Type
definition property symbol
cannot be undefined
.
TypeScript/src/compiler/types.ts
Line 4365 in 56b6d0d
symbol: Symbol; // Symbol associated with type (if any) |
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?
Fixes #37014