Skip to content

Commit 91c1a81

Browse files
committed
Fix isTypeNode to not consider namespace accesses types
1 parent 971a4c5 commit 91c1a81

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/compiler/checker.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6704,7 +6704,13 @@ module ts {
67046704
if (parent.kind === SyntaxKind.TypeQuery) {
67056705
return false;
67066706
}
6707-
if (isTypeNode(parent)) {
6707+
// Do not recursively call isTypeNode on the parent. In the example:
6708+
//
6709+
// var a: A.B.C;
6710+
//
6711+
// Calling isTypeNode would consider the qualified name A.B a type node. Only C or
6712+
// A.B.C is a type node.
6713+
if (node.kind >= SyntaxKind.FirstTypeNode && node.kind <= SyntaxKind.LastTypeNode) {
67086714
return true;
67096715
}
67106716
switch (parent.kind) {

0 commit comments

Comments
 (0)