Skip to content

Commit 742d515

Browse files
author
Yui T
committed
Fix baselines and function call from merging master
1 parent feb41f7 commit 742d515

5 files changed

+30
-30
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15701,7 +15701,7 @@ namespace ts {
1570115701
// resolveExternalModuleName will return undefined if the moduleReferenceExpression is not a string literal
1570215702
const moduleSymbol = resolveExternalModuleName(node, specifier);
1570315703
if (moduleSymbol) {
15704-
const esModuleSymbol = resolveESModuleSymbol(moduleSymbol, specifier);
15704+
const esModuleSymbol = resolveESModuleSymbol(moduleSymbol, specifier, /*dontRecursivelyResolve*/ true);
1570515705
if (esModuleSymbol) {
1570615706
return createPromiseReturnType(node, getTypeOfSymbol(esModuleSymbol));
1570715707
}
@@ -17284,7 +17284,7 @@ namespace ts {
1728417284
if ((<CallExpression>node).expression.kind === SyntaxKind.ImportKeyword) {
1728517285
return checkImportCallExpression(<ImportCall>node);
1728617286
}
17287-
// Fall through
17287+
/* tslint:disable: no-switch-case-fall-through */
1728817288
case SyntaxKind.NewExpression:
1728917289
return checkCallExpression(<CallExpression>node);
1729017290
case SyntaxKind.TaggedTemplateExpression:
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
tests/cases/conformance/es2018/dynamicImport/1.ts(1,1): error TS1320: Dynamic import cannot be used when targeting ECMAScript 2015 modules.
2-
tests/cases/conformance/es2018/dynamicImport/1.ts(2,10): error TS1320: Dynamic import cannot be used when targeting ECMAScript 2015 modules.
3-
tests/cases/conformance/es2018/dynamicImport/1.ts(8,16): error TS1320: Dynamic import cannot be used when targeting ECMAScript 2015 modules.
1+
tests/cases/conformance/es2018/dynamicImport/1.ts(1,1): error TS1323: Dynamic import cannot be used when targeting ECMAScript 2015 modules.
2+
tests/cases/conformance/es2018/dynamicImport/1.ts(2,10): error TS1323: Dynamic import cannot be used when targeting ECMAScript 2015 modules.
3+
tests/cases/conformance/es2018/dynamicImport/1.ts(8,16): error TS1323: Dynamic import cannot be used when targeting ECMAScript 2015 modules.
44

55

66
==== tests/cases/conformance/es2018/dynamicImport/0.ts (0 errors) ====
@@ -9,16 +9,16 @@ tests/cases/conformance/es2018/dynamicImport/1.ts(8,16): error TS1320: Dynamic i
99
==== tests/cases/conformance/es2018/dynamicImport/1.ts (3 errors) ====
1010
import("./0");
1111
~~~~~~~~~~~~~
12-
!!! error TS1320: Dynamic import cannot be used when targeting ECMAScript 2015 modules.
12+
!!! error TS1323: Dynamic import cannot be used when targeting ECMAScript 2015 modules.
1313
var p1 = import("./0");
1414
~~~~~~~~~~~~~
15-
!!! error TS1320: Dynamic import cannot be used when targeting ECMAScript 2015 modules.
15+
!!! error TS1323: Dynamic import cannot be used when targeting ECMAScript 2015 modules.
1616
p1.then(zero => {
1717
return zero.foo();
1818
})
1919

2020
function foo() {
2121
const p2 = import("./0");
2222
~~~~~~~~~~~~~
23-
!!! error TS1320: Dynamic import cannot be used when targeting ECMAScript 2015 modules.
23+
!!! error TS1323: Dynamic import cannot be used when targeting ECMAScript 2015 modules.
2424
}
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts(5,8): error TS1322: Specifier of dynamic import cannot be spread element.
2-
tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts(7,17): error TS1322: Specifier of dynamic import cannot be spread element.
3-
tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts(8,12): error TS1321: Dynamic import must have one specifier as an argument.
1+
tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts(5,8): error TS1325: Specifier of dynamic import cannot be spread element.
2+
tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts(7,17): error TS1325: Specifier of dynamic import cannot be spread element.
3+
tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts(8,12): error TS1324: Dynamic import must have one specifier as an argument.
44
tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts(9,19): error TS1135: Argument expression expected.
5-
tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts(10,12): error TS1321: Dynamic import must have one specifier as an argument.
5+
tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts(10,12): error TS1324: Dynamic import must have one specifier as an argument.
66

77

88
==== tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts (5 errors) ====
@@ -12,17 +12,17 @@ tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts
1212
var a = ["./0"];
1313
import(...["PathModule"]);
1414
~~~~~~~~~~~~~~~~~
15-
!!! error TS1322: Specifier of dynamic import cannot be spread element.
15+
!!! error TS1325: Specifier of dynamic import cannot be spread element.
1616

1717
var p1 = import(...a);
1818
~~~~
19-
!!! error TS1322: Specifier of dynamic import cannot be spread element.
19+
!!! error TS1325: Specifier of dynamic import cannot be spread element.
2020
const p2 = import();
2121
~~~~~~~~
22-
!!! error TS1321: Dynamic import must have one specifier as an argument.
22+
!!! error TS1324: Dynamic import must have one specifier as an argument.
2323
const p3 = import(,);
2424

2525
!!! error TS1135: Argument expression expected.
2626
const p4 = import("pathToModule", "secondModule");
2727
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
28-
!!! error TS1321: Dynamic import must have one specifier as an argument.
28+
!!! error TS1324: Dynamic import must have one specifier as an argument.
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
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'.
2-
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'.
3-
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"'.
4-
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[]'.
5-
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'.
1+
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'.
2+
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'.
3+
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"'.
4+
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[]'.
5+
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'.
66

77

88
==== tests/cases/conformance/es2018/dynamicImport/importCallExpressionSpecifierNotStringTypeError.ts (5 errors) ====
@@ -12,20 +12,20 @@ tests/cases/conformance/es2018/dynamicImport/importCallExpressionSpecifierNotStr
1212
// Error specifier is not assignable to string
1313
import(getSpecifier());
1414
~~~~~~~~~~~~~~
15-
!!! error TS7035: Dynamic import's specifier must be of type 'string', but here has type 'boolean'.
15+
!!! error TS7036: Dynamic import's specifier must be of type 'string', but here has type 'boolean'.
1616
var p1 = import(getSpecifier());
1717
~~~~~~~~~~~~~~
18-
!!! error TS7035: Dynamic import's specifier must be of type 'string', but here has type 'boolean'.
18+
!!! error TS7036: Dynamic import's specifier must be of type 'string', but here has type 'boolean'.
1919
const p2 = import(whatToLoad ? getSpecifier() : "defaulPath")
2020
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21-
!!! error TS7035: Dynamic import's specifier must be of type 'string', but here has type 'boolean | "defaulPath"'.
21+
!!! error TS7036: Dynamic import's specifier must be of type 'string', but here has type 'boolean | "defaulPath"'.
2222
p1.then(zero => {
2323
return zero.foo(); // ok, zero is any
2424
});
2525

2626
var p3 = import(["path1", "path2"]);
2727
~~~~~~~~~~~~~~~~~~
28-
!!! error TS7035: Dynamic import's specifier must be of type 'string', but here has type 'string[]'.
28+
!!! error TS7036: Dynamic import's specifier must be of type 'string', but here has type 'string[]'.
2929
var p4 = import(()=>"PathToModule");
3030
~~~~~~~~~~~~~~~~~~
31-
!!! error TS7035: Dynamic import's specifier must be of type 'string', but here has type '() => string'.
31+
!!! error TS7036: Dynamic import's specifier must be of type 'string', but here has type '() => string'.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
tests/cases/conformance/es2018/dynamicImport/1.ts(2,10): error TS1323: Dynamic import cannot have type arguments
2-
tests/cases/conformance/es2018/dynamicImport/1.ts(3,10): error TS1323: Dynamic import cannot have type arguments
1+
tests/cases/conformance/es2018/dynamicImport/1.ts(2,10): error TS1326: Dynamic import cannot have type arguments
2+
tests/cases/conformance/es2018/dynamicImport/1.ts(3,10): error TS1326: Dynamic import cannot have type arguments
33

44

55
==== 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
99
"use strict"
1010
var p1 = import<Promise<any>>("./0"); // error
1111
~~~~~~~~~~~~~~~~~~~~~~~~~~~
12-
!!! error TS1323: Dynamic import cannot have type arguments
12+
!!! error TS1326: Dynamic import cannot have type arguments
1313
var p2 = import<>("./0"); // error
1414
~~~~~~~~~~~~~~~
15-
!!! error TS1323: Dynamic import cannot have type arguments
15+
!!! error TS1326: Dynamic import cannot have type arguments
1616
// p1.then(value => {
1717
// value.anyFunction();
1818
// })

0 commit comments

Comments
 (0)