@@ -4560,16 +4560,16 @@ var ts;
4560
4560
}
4561
4561
function parsePrimaryExpression() {
4562
4562
switch (token) {
4563
+ case 6 /* NumericLiteral */:
4564
+ case 7 /* StringLiteral */:
4565
+ case 9 /* NoSubstitutionTemplateLiteral */:
4566
+ return parseLiteralNode();
4563
4567
case 91 /* ThisKeyword */:
4564
4568
case 89 /* SuperKeyword */:
4565
4569
case 87 /* NullKeyword */:
4566
4570
case 93 /* TrueKeyword */:
4567
4571
case 78 /* FalseKeyword */:
4568
4572
return parseTokenNode();
4569
- case 6 /* NumericLiteral */:
4570
- case 7 /* StringLiteral */:
4571
- case 9 /* NoSubstitutionTemplateLiteral */:
4572
- return parseLiteralNode();
4573
4573
case 15 /* OpenParenToken */:
4574
4574
return parseParenthesizedExpression();
4575
4575
case 17 /* OpenBracketToken */:
@@ -6592,7 +6592,10 @@ var ts;
6592
6592
}
6593
6593
}
6594
6594
else {
6595
- if (!(findSourceFile(filename + ".ts", isDefaultLib, refFile, refPos, refEnd) || findSourceFile(filename + ".d.ts", isDefaultLib, refFile, refPos, refEnd))) {
6595
+ if (options.allowNonTsExtensions && !findSourceFile(filename, isDefaultLib, refFile, refPos, refEnd)) {
6596
+ diagnostic = ts.Diagnostics.File_0_not_found;
6597
+ }
6598
+ else if (!findSourceFile(filename + ".ts", isDefaultLib, refFile, refPos, refEnd) && !findSourceFile(filename + ".d.ts", isDefaultLib, refFile, refPos, refEnd)) {
6596
6599
diagnostic = ts.Diagnostics.File_0_not_found;
6597
6600
filename += ".ts";
6598
6601
}
@@ -11583,7 +11586,6 @@ var ts;
11583
11586
case 131 /* IndexSignature */:
11584
11587
case 123 /* Parameter */:
11585
11588
case 190 /* ModuleBlock */:
11586
- case 122 /* TypeParameter */:
11587
11589
case 133 /* FunctionType */:
11588
11590
case 134 /* ConstructorType */:
11589
11591
case 136 /* TypeLiteral */:
@@ -11593,6 +11595,7 @@ var ts;
11593
11595
case 139 /* UnionType */:
11594
11596
case 140 /* ParenthesizedType */:
11595
11597
return isDeclarationVisible(node.parent);
11598
+ case 122 /* TypeParameter */:
11596
11599
case 201 /* SourceFile */:
11597
11600
return true;
11598
11601
default:
@@ -17569,8 +17572,17 @@ var ts;
17569
17572
}
17570
17573
function isUniqueLocalName(name, container) {
17571
17574
for (var node = container; isNodeDescendentOf(node, container); node = node.nextContainer) {
17572
- if (node.locals && ts.hasProperty(node.locals, name) && node.locals[name].flags & (107455 /* Value */ | 4194304 /* ExportValue */)) {
17573
- return false;
17575
+ if (node.locals && ts.hasProperty(node.locals, name)) {
17576
+ var symbolWithRelevantName = node.locals[name];
17577
+ if (symbolWithRelevantName.flags & (107455 /* Value */ | 4194304 /* ExportValue */)) {
17578
+ return false;
17579
+ }
17580
+ if (symbolWithRelevantName.flags & 33554432 /* Import */) {
17581
+ var importDeclarationWithRelevantName = ts.getDeclarationOfKind(symbolWithRelevantName, 191 /* ImportDeclaration */);
17582
+ if (isReferencedImportDeclaration(importDeclarationWithRelevantName)) {
17583
+ return false;
17584
+ }
17585
+ }
17574
17586
}
17575
17587
}
17576
17588
return true;
0 commit comments