diff --git a/tests/cases/conformance/es2018/dynamicImport/importCallExpression2ES2018.ts b/tests/cases/conformance/es2018/dynamicImport/importCallExpression2ES2018.ts index 3cb6fd7bc92..994e6f9e776 100644 --- a/tests/cases/conformance/es2018/dynamicImport/importCallExpression2ES2018.ts +++ b/tests/cases/conformance/es2018/dynamicImport/importCallExpression2ES2018.ts @@ -6,7 +6,6 @@ export class B { } // @filename: 2.ts -// We use Promise for now as there is no way to specify shape of module object function foo(x: Promise) { x.then(value => { let b = new value.B(); diff --git a/tests/cases/conformance/es2018/dynamicImport/importCallExpressionCheckReturntype1.ts b/tests/cases/conformance/es2018/dynamicImport/importCallExpressionCheckReturntype1.ts new file mode 100644 index 00000000000..1218565fa54 --- /dev/null +++ b/tests/cases/conformance/es2018/dynamicImport/importCallExpressionCheckReturntype1.ts @@ -0,0 +1,17 @@ +// @module: commonjs +// @target: es6 +// @noImplicitAny: true + +// @filename: anotherModule.ts +export class D{} + +// @filename: defaultPath.ts +export class C {} + +// @filename: 1.ts +import * as defaultModule from "./defaultPath"; +import * as anotherModule from "./anotherModule"; + +let p1: Promise = import("./defaultPath"); +let p2 = import("./defaultPath") as Promise; +let p3: Promise = import("./defaultPath"); diff --git a/tests/cases/conformance/es2018/dynamicImport/importCallExpressionDeclarationEmit2.ts b/tests/cases/conformance/es2018/dynamicImport/importCallExpressionDeclarationEmit2.ts index d1ee592a98a..7d9b5fec1d0 100644 --- a/tests/cases/conformance/es2018/dynamicImport/importCallExpressionDeclarationEmit2.ts +++ b/tests/cases/conformance/es2018/dynamicImport/importCallExpressionDeclarationEmit2.ts @@ -6,5 +6,4 @@ export function foo() { return "foo"; } // @filename: 1.ts -import("./0"); var p1 = import("./0"); \ No newline at end of file diff --git a/tests/cases/conformance/es2018/dynamicImport/importCallExpressionDeclarationEmit3.ts b/tests/cases/conformance/es2018/dynamicImport/importCallExpressionDeclarationEmit3.ts new file mode 100644 index 00000000000..cde7ad0a42f --- /dev/null +++ b/tests/cases/conformance/es2018/dynamicImport/importCallExpressionDeclarationEmit3.ts @@ -0,0 +1,15 @@ +// @module: es2018 +// @target: esnext +// @declaration: true + +// @filename: 0.ts +export function foo() { return "foo"; } + +// @filename: 1.ts +declare function getPath(): string; +import * as Zero from "./0"; +import("./0"); + +export var p0: Promise = import(getPath()); +export var p1: Promise = import("./0"); +export var p2: Promise = import("./0"); diff --git a/tests/cases/conformance/es2018/dynamicImport/importCallExpressionAllowInScriptContext1.ts b/tests/cases/conformance/es2018/dynamicImport/importCallExpressionInScriptContext1.ts similarity index 100% rename from tests/cases/conformance/es2018/dynamicImport/importCallExpressionAllowInScriptContext1.ts rename to tests/cases/conformance/es2018/dynamicImport/importCallExpressionInScriptContext1.ts diff --git a/tests/cases/conformance/es2018/dynamicImport/importCallExpressionAllowInScriptContext2.ts b/tests/cases/conformance/es2018/dynamicImport/importCallExpressionInScriptContext2.ts similarity index 100% rename from tests/cases/conformance/es2018/dynamicImport/importCallExpressionAllowInScriptContext2.ts rename to tests/cases/conformance/es2018/dynamicImport/importCallExpressionInScriptContext2.ts