TypeScript/tests/cases/conformance/dynamicImport/importCallExpressionInCJS3.ts
2017-06-05 17:16:29 -07:00

17 lines
365 B
TypeScript

// @module: commonjs
// @target: esnext
// @filename: 0.ts
export class B {
print() { return "I am B"}
}
// @filename: 2.ts
// We use Promise<any> for now as there is no way to specify shape of module object
function foo(x: Promise<any>) {
x.then(value => {
let b = new value.B();
b.print();
})
}
foo(import("./0"));