From 91c1a8156387aa8f44e6cc0572840c1eb207ca9f Mon Sep 17 00:00:00 2001 From: Jason Freeman Date: Fri, 15 Aug 2014 14:30:51 -0700 Subject: [PATCH] Fix isTypeNode to not consider namespace accesses types --- src/compiler/checker.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 0da095fbbe6..8ab7145c40f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -6704,7 +6704,13 @@ module ts { if (parent.kind === SyntaxKind.TypeQuery) { return false; } - if (isTypeNode(parent)) { + // Do not recursively call isTypeNode on the parent. In the example: + // + // var a: A.B.C; + // + // Calling isTypeNode would consider the qualified name A.B a type node. Only C or + // A.B.C is a type node. + if (node.kind >= SyntaxKind.FirstTypeNode && node.kind <= SyntaxKind.LastTypeNode) { return true; } switch (parent.kind) {