Skip to content

Commit bd1155c

Browse files
committed
getLiteralTypeFromProperty-check privateIdentifier
1 parent 99d11db commit bd1155c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/compiler/checker.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10005,6 +10005,9 @@ namespace ts {
1000510005
}
1000610006
else {
1000710007
const name = prop.valueDeclaration && getNameOfDeclaration(prop.valueDeclaration) as PropertyName;
10008+
if (isPrivateIdentifier(name)) {
10009+
return neverType;
10010+
}
1000810011
type = name && getLiteralTypeFromPropertyName(name) || getLiteralType(symbolName(prop));
1000910012
}
1001010013
}

0 commit comments

Comments
 (0)