mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Fix for crash when using ca call expression on private identifier coming from an any typed variable. (GH #42860) (#42861)
This commit is contained in:
+10
-1
@@ -21978,7 +21978,16 @@ namespace ts {
|
||||
const type = getTypeOfDottedName((<PropertyAccessExpression>node).expression, diagnostic);
|
||||
if (type) {
|
||||
const name = (<PropertyAccessExpression>node).name;
|
||||
const prop = getPropertyOfType(type, isPrivateIdentifier(name) ? getSymbolNameForPrivateIdentifier(type.symbol, name.escapedText) : name.escapedText);
|
||||
let prop: Symbol | undefined;
|
||||
if (isPrivateIdentifier(name)) {
|
||||
if (!type.symbol) {
|
||||
return undefined;
|
||||
}
|
||||
prop = getPropertyOfType(type, getSymbolNameForPrivateIdentifier(type.symbol, name.escapedText));
|
||||
}
|
||||
else {
|
||||
prop = getPropertyOfType(type, name.escapedText);
|
||||
}
|
||||
return prop && getExplicitTypeOfSymbol(prop, diagnostic);
|
||||
}
|
||||
return undefined;
|
||||
|
||||
Reference in New Issue
Block a user