Skip to content

Commit db44a71

Browse files
author
Andy Hanson
committed
Fix bug
1 parent 91c9d76 commit db44a71

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

src/compiler/checker.ts

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -980,21 +980,23 @@ namespace ts {
980980
* but returns undefined if that expression is not an EntityNameExpression.
981981
*/
982982
function climbToEntityNameOfExpressionWithTypeArguments(node: Node): EntityNameExpression | undefined {
983-
switch (node.kind) {
984-
case SyntaxKind.Identifier:
985-
case SyntaxKind.PropertyAccessExpression:
986-
if (node.parent) {
987-
node = node.parent;
988-
}
989-
else {
983+
for (; ; ) {
984+
switch (node.kind) {
985+
case SyntaxKind.Identifier:
986+
case SyntaxKind.PropertyAccessExpression:
987+
if (node.parent) {
988+
node = node.parent;
989+
}
990+
else {
991+
return undefined;
992+
}
993+
break;
994+
case SyntaxKind.ExpressionWithTypeArguments:
995+
Debug.assert(isEntityNameExpression((<ExpressionWithTypeArguments>node).expression));
996+
return <EntityNameExpression>(<ExpressionWithTypeArguments>node).expression;
997+
default:
990998
return undefined;
991-
}
992-
break;
993-
case SyntaxKind.ExpressionWithTypeArguments:
994-
Debug.assert(isEntityNameExpression((<ExpressionWithTypeArguments>node).expression));
995-
return <EntityNameExpression>(<ExpressionWithTypeArguments>node).expression;
996-
default:
997-
return undefined;
999+
}
9981000
}
9991001
}
10001002

0 commit comments

Comments
 (0)