Skip to content

Commit 34a5589

Browse files
author
Andy
authored
Remove unnecessary call to getApparentType (microsoft#17788)
1 parent ce2ac17 commit 34a5589

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/compiler/checker.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22918,10 +22918,7 @@ namespace ts {
2291822918
// index access
2291922919
if (node.parent.kind === SyntaxKind.ElementAccessExpression && (<ElementAccessExpression>node.parent).argumentExpression === node) {
2292022920
const objectType = getTypeOfExpression((<ElementAccessExpression>node.parent).expression);
22921-
if (objectType === unknownType) return undefined;
22922-
const apparentType = getApparentType(objectType);
22923-
if (apparentType === unknownType) return undefined;
22924-
return getPropertyOfType(apparentType, (<NumericLiteral>node).text as __String);
22921+
return getPropertyOfType(objectType, (<NumericLiteral>node).text as __String);
2292522922
}
2292622923
break;
2292722924
}

0 commit comments

Comments
 (0)