mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-22 22:55:36 -05:00
fix(42166): allow assertion signature for private identifiers (#42176)
This commit is contained in:
@@ -21852,10 +21852,15 @@ namespace ts {
|
||||
return getExplicitThisType(node);
|
||||
case SyntaxKind.SuperKeyword:
|
||||
return checkSuperExpression(node);
|
||||
case SyntaxKind.PropertyAccessExpression:
|
||||
case SyntaxKind.PropertyAccessExpression: {
|
||||
const type = getTypeOfDottedName((<PropertyAccessExpression>node).expression, diagnostic);
|
||||
const prop = type && getPropertyOfType(type, (<PropertyAccessExpression>node).name.escapedText);
|
||||
return prop && getExplicitTypeOfSymbol(prop, diagnostic);
|
||||
if (type) {
|
||||
const name = (<PropertyAccessExpression>node).name;
|
||||
const prop = getPropertyOfType(type, isPrivateIdentifier(name) ? getSymbolNameForPrivateIdentifier(type.symbol, name.escapedText) : name.escapedText);
|
||||
return prop && getExplicitTypeOfSymbol(prop, diagnostic);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
case SyntaxKind.ParenthesizedExpression:
|
||||
return getTypeOfDottedName((<ParenthesizedExpression>node).expression, diagnostic);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user