mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-29 14:04:20 -05:00
Include super.XXX(...) assertion method calls in CFA (#36293)
* Support super.XXX in assertions * Add tests
This commit is contained in:
@@ -19075,6 +19075,8 @@ namespace ts {
|
||||
return getExplicitTypeOfSymbol(symbol.flags & SymbolFlags.Alias ? resolveAlias(symbol) : symbol, diagnostic);
|
||||
case SyntaxKind.ThisKeyword:
|
||||
return getExplicitThisType(node);
|
||||
case SyntaxKind.SuperKeyword:
|
||||
return checkSuperExpression(node);
|
||||
case SyntaxKind.PropertyAccessExpression:
|
||||
const type = getTypeOfDottedName((<PropertyAccessExpression>node).expression, diagnostic);
|
||||
const prop = type && getPropertyOfType(type, (<PropertyAccessExpression>node).name.escapedText);
|
||||
|
||||
@@ -4278,7 +4278,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
export function isDottedName(node: Expression): boolean {
|
||||
return node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.ThisKeyword ||
|
||||
return node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.ThisKeyword || node.kind === SyntaxKind.SuperKeyword ||
|
||||
node.kind === SyntaxKind.PropertyAccessExpression && isDottedName((<PropertyAccessExpression>node).expression) ||
|
||||
node.kind === SyntaxKind.ParenthesizedExpression && isDottedName((<ParenthesizedExpression>node).expression);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user