From 742d5150a55fc5b9b3fb41685c18a17d152f18fc Mon Sep 17 00:00:00 2001 From: Yui T Date: Wed, 26 Apr 2017 15:38:58 -0700 Subject: [PATCH] Fix baselines and function call from merging master --- src/compiler/checker.ts | 4 ++-- ...portCallExpressionErrorInES2015.errors.txt | 12 +++++------ ...mportCallExpressionGrammarError.errors.txt | 16 +++++++-------- ...sionSpecifierNotStringTypeError.errors.txt | 20 +++++++++---------- ...tCallExpressionWithTypeArgument.errors.txt | 8 ++++---- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index cb3962ae4e0..9a2a07f53c1 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -15701,7 +15701,7 @@ namespace ts { // resolveExternalModuleName will return undefined if the moduleReferenceExpression is not a string literal const moduleSymbol = resolveExternalModuleName(node, specifier); if (moduleSymbol) { - const esModuleSymbol = resolveESModuleSymbol(moduleSymbol, specifier); + const esModuleSymbol = resolveESModuleSymbol(moduleSymbol, specifier, /*dontRecursivelyResolve*/ true); if (esModuleSymbol) { return createPromiseReturnType(node, getTypeOfSymbol(esModuleSymbol)); } @@ -17284,7 +17284,7 @@ namespace ts { if ((node).expression.kind === SyntaxKind.ImportKeyword) { return checkImportCallExpression(node); } - // Fall through + /* tslint:disable: no-switch-case-fall-through */ case SyntaxKind.NewExpression: return checkCallExpression(node); case SyntaxKind.TaggedTemplateExpression: diff --git a/tests/baselines/reference/importCallExpressionErrorInES2015.errors.txt b/tests/baselines/reference/importCallExpressionErrorInES2015.errors.txt index ccd867f831c..0c31a0f434c 100644 --- a/tests/baselines/reference/importCallExpressionErrorInES2015.errors.txt +++ b/tests/baselines/reference/importCallExpressionErrorInES2015.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/es2018/dynamicImport/1.ts(1,1): error TS1320: Dynamic import cannot be used when targeting ECMAScript 2015 modules. -tests/cases/conformance/es2018/dynamicImport/1.ts(2,10): error TS1320: Dynamic import cannot be used when targeting ECMAScript 2015 modules. -tests/cases/conformance/es2018/dynamicImport/1.ts(8,16): error TS1320: Dynamic import cannot be used when targeting ECMAScript 2015 modules. +tests/cases/conformance/es2018/dynamicImport/1.ts(1,1): error TS1323: Dynamic import cannot be used when targeting ECMAScript 2015 modules. +tests/cases/conformance/es2018/dynamicImport/1.ts(2,10): error TS1323: Dynamic import cannot be used when targeting ECMAScript 2015 modules. +tests/cases/conformance/es2018/dynamicImport/1.ts(8,16): error TS1323: Dynamic import cannot be used when targeting ECMAScript 2015 modules. ==== tests/cases/conformance/es2018/dynamicImport/0.ts (0 errors) ==== @@ -9,10 +9,10 @@ tests/cases/conformance/es2018/dynamicImport/1.ts(8,16): error TS1320: Dynamic i ==== tests/cases/conformance/es2018/dynamicImport/1.ts (3 errors) ==== import("./0"); ~~~~~~~~~~~~~ -!!! error TS1320: Dynamic import cannot be used when targeting ECMAScript 2015 modules. +!!! error TS1323: Dynamic import cannot be used when targeting ECMAScript 2015 modules. var p1 = import("./0"); ~~~~~~~~~~~~~ -!!! error TS1320: Dynamic import cannot be used when targeting ECMAScript 2015 modules. +!!! error TS1323: Dynamic import cannot be used when targeting ECMAScript 2015 modules. p1.then(zero => { return zero.foo(); }) @@ -20,5 +20,5 @@ tests/cases/conformance/es2018/dynamicImport/1.ts(8,16): error TS1320: Dynamic i function foo() { const p2 = import("./0"); ~~~~~~~~~~~~~ -!!! error TS1320: Dynamic import cannot be used when targeting ECMAScript 2015 modules. +!!! error TS1323: Dynamic import cannot be used when targeting ECMAScript 2015 modules. } \ No newline at end of file diff --git a/tests/baselines/reference/importCallExpressionGrammarError.errors.txt b/tests/baselines/reference/importCallExpressionGrammarError.errors.txt index c089452be3b..c4c62b8ff8f 100644 --- a/tests/baselines/reference/importCallExpressionGrammarError.errors.txt +++ b/tests/baselines/reference/importCallExpressionGrammarError.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts(5,8): error TS1322: Specifier of dynamic import cannot be spread element. -tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts(7,17): error TS1322: Specifier of dynamic import cannot be spread element. -tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts(8,12): error TS1321: Dynamic import must have one specifier as an argument. +tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts(5,8): error TS1325: Specifier of dynamic import cannot be spread element. +tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts(7,17): error TS1325: Specifier of dynamic import cannot be spread element. +tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts(8,12): error TS1324: Dynamic import must have one specifier as an argument. tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts(9,19): error TS1135: Argument expression expected. -tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts(10,12): error TS1321: Dynamic import must have one specifier as an argument. +tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts(10,12): error TS1324: Dynamic import must have one specifier as an argument. ==== tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts (5 errors) ==== @@ -12,17 +12,17 @@ tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts var a = ["./0"]; import(...["PathModule"]); ~~~~~~~~~~~~~~~~~ -!!! error TS1322: Specifier of dynamic import cannot be spread element. +!!! error TS1325: Specifier of dynamic import cannot be spread element. var p1 = import(...a); ~~~~ -!!! error TS1322: Specifier of dynamic import cannot be spread element. +!!! error TS1325: Specifier of dynamic import cannot be spread element. const p2 = import(); ~~~~~~~~ -!!! error TS1321: Dynamic import must have one specifier as an argument. +!!! error TS1324: Dynamic import must have one specifier as an argument. const p3 = import(,); !!! error TS1135: Argument expression expected. const p4 = import("pathToModule", "secondModule"); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1321: Dynamic import must have one specifier as an argument. \ No newline at end of file +!!! error TS1324: Dynamic import must have one specifier as an argument. \ No newline at end of file diff --git a/tests/baselines/reference/importCallExpressionSpecifierNotStringTypeError.errors.txt b/tests/baselines/reference/importCallExpressionSpecifierNotStringTypeError.errors.txt index 575247b2380..dd705582827 100644 --- a/tests/baselines/reference/importCallExpressionSpecifierNotStringTypeError.errors.txt +++ b/tests/baselines/reference/importCallExpressionSpecifierNotStringTypeError.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/es2018/dynamicImport/importCallExpressionSpecifierNotStringTypeError.ts(5,8): error TS7035: Dynamic import's specifier must be of type 'string', but here has type 'boolean'. -tests/cases/conformance/es2018/dynamicImport/importCallExpressionSpecifierNotStringTypeError.ts(6,17): error TS7035: Dynamic import's specifier must be of type 'string', but here has type 'boolean'. -tests/cases/conformance/es2018/dynamicImport/importCallExpressionSpecifierNotStringTypeError.ts(7,19): error TS7035: Dynamic import's specifier must be of type 'string', but here has type 'boolean | "defaulPath"'. -tests/cases/conformance/es2018/dynamicImport/importCallExpressionSpecifierNotStringTypeError.ts(12,17): error TS7035: Dynamic import's specifier must be of type 'string', but here has type 'string[]'. -tests/cases/conformance/es2018/dynamicImport/importCallExpressionSpecifierNotStringTypeError.ts(13,17): error TS7035: Dynamic import's specifier must be of type 'string', but here has type '() => string'. +tests/cases/conformance/es2018/dynamicImport/importCallExpressionSpecifierNotStringTypeError.ts(5,8): error TS7036: Dynamic import's specifier must be of type 'string', but here has type 'boolean'. +tests/cases/conformance/es2018/dynamicImport/importCallExpressionSpecifierNotStringTypeError.ts(6,17): error TS7036: Dynamic import's specifier must be of type 'string', but here has type 'boolean'. +tests/cases/conformance/es2018/dynamicImport/importCallExpressionSpecifierNotStringTypeError.ts(7,19): error TS7036: Dynamic import's specifier must be of type 'string', but here has type 'boolean | "defaulPath"'. +tests/cases/conformance/es2018/dynamicImport/importCallExpressionSpecifierNotStringTypeError.ts(12,17): error TS7036: Dynamic import's specifier must be of type 'string', but here has type 'string[]'. +tests/cases/conformance/es2018/dynamicImport/importCallExpressionSpecifierNotStringTypeError.ts(13,17): error TS7036: Dynamic import's specifier must be of type 'string', but here has type '() => string'. ==== tests/cases/conformance/es2018/dynamicImport/importCallExpressionSpecifierNotStringTypeError.ts (5 errors) ==== @@ -12,20 +12,20 @@ tests/cases/conformance/es2018/dynamicImport/importCallExpressionSpecifierNotStr // Error specifier is not assignable to string import(getSpecifier()); ~~~~~~~~~~~~~~ -!!! error TS7035: Dynamic import's specifier must be of type 'string', but here has type 'boolean'. +!!! error TS7036: Dynamic import's specifier must be of type 'string', but here has type 'boolean'. var p1 = import(getSpecifier()); ~~~~~~~~~~~~~~ -!!! error TS7035: Dynamic import's specifier must be of type 'string', but here has type 'boolean'. +!!! error TS7036: Dynamic import's specifier must be of type 'string', but here has type 'boolean'. const p2 = import(whatToLoad ? getSpecifier() : "defaulPath") ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS7035: Dynamic import's specifier must be of type 'string', but here has type 'boolean | "defaulPath"'. +!!! error TS7036: Dynamic import's specifier must be of type 'string', but here has type 'boolean | "defaulPath"'. p1.then(zero => { return zero.foo(); // ok, zero is any }); var p3 = import(["path1", "path2"]); ~~~~~~~~~~~~~~~~~~ -!!! error TS7035: Dynamic import's specifier must be of type 'string', but here has type 'string[]'. +!!! error TS7036: Dynamic import's specifier must be of type 'string', but here has type 'string[]'. var p4 = import(()=>"PathToModule"); ~~~~~~~~~~~~~~~~~~ -!!! error TS7035: Dynamic import's specifier must be of type 'string', but here has type '() => string'. \ No newline at end of file +!!! error TS7036: Dynamic import's specifier must be of type 'string', but here has type '() => string'. \ No newline at end of file diff --git a/tests/baselines/reference/importCallExpressionWithTypeArgument.errors.txt b/tests/baselines/reference/importCallExpressionWithTypeArgument.errors.txt index f0076f223fd..f9375ec695f 100644 --- a/tests/baselines/reference/importCallExpressionWithTypeArgument.errors.txt +++ b/tests/baselines/reference/importCallExpressionWithTypeArgument.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/es2018/dynamicImport/1.ts(2,10): error TS1323: Dynamic import cannot have type arguments -tests/cases/conformance/es2018/dynamicImport/1.ts(3,10): error TS1323: Dynamic import cannot have type arguments +tests/cases/conformance/es2018/dynamicImport/1.ts(2,10): error TS1326: Dynamic import cannot have type arguments +tests/cases/conformance/es2018/dynamicImport/1.ts(3,10): error TS1326: Dynamic import cannot have type arguments ==== tests/cases/conformance/es2018/dynamicImport/0.ts (0 errors) ==== @@ -9,10 +9,10 @@ tests/cases/conformance/es2018/dynamicImport/1.ts(3,10): error TS1323: Dynamic i "use strict" var p1 = import>("./0"); // error ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic import cannot have type arguments +!!! error TS1326: Dynamic import cannot have type arguments var p2 = import<>("./0"); // error ~~~~~~~~~~~~~~~ -!!! error TS1323: Dynamic import cannot have type arguments +!!! error TS1326: Dynamic import cannot have type arguments // p1.then(value => { // value.anyFunction(); // }) \ No newline at end of file