Fix isTypeNode to not consider namespace accesses types

This commit is contained in:
Jason Freeman 2014-08-15 14:30:51 -07:00
parent 971a4c55d4
commit 91c1a81563

View File

@ -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) {