Skip to content

Commit d8ce7d7

Browse files
committed
Check for undefined source.symbol
Fixes #37014
1 parent 26184f0 commit d8ce7d7

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16239,6 +16239,7 @@ namespace ts {
1623916239
if (unmatchedProperty.valueDeclaration
1624016240
&& isNamedDeclaration(unmatchedProperty.valueDeclaration)
1624116241
&& isPrivateIdentifier(unmatchedProperty.valueDeclaration.name)
16242+
&& source.symbol
1624216243
&& source.symbol.flags & SymbolFlags.Class) {
1624316244
const privateIdentifierDescription = unmatchedProperty.valueDeclaration.name.escapedText;
1624416245
const symbolTableKey = getSymbolNameForPrivateIdentifier(source.symbol, privateIdentifierDescription);
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export class Class {
2+
#field: any
3+
}
4+
5+
const task: Class = {} as unknown;

0 commit comments

Comments
 (0)