2018-03-06 20:00:41 +01:00
|
|
|
/// <reference path='fourslash.ts' />
|
|
|
|
|
|
|
|
// @noImplicitAny: true
|
|
|
|
|
|
|
|
// @Filename: /a.ts
|
|
|
|
////export class D {}
|
|
|
|
////export default new D();
|
|
|
|
|
|
|
|
// @Filename: /b.ts
|
|
|
|
////export class C {
|
2018-04-05 21:33:00 +02:00
|
|
|
//// [|set x(val) { val; }|]
|
2018-03-06 20:00:41 +01:00
|
|
|
//// method() { this.x = import("./a"); }
|
|
|
|
////}
|
|
|
|
|
|
|
|
goTo.file("/b.ts");
|
2018-06-20 01:36:18 +02:00
|
|
|
verify.codeFix({
|
|
|
|
index: 0,
|
|
|
|
description: "Infer type of 'x' from usage",
|
|
|
|
newFileContent:
|
|
|
|
`export class C {
|
2018-10-09 16:12:09 +02:00
|
|
|
set x(val: Promise<typeof import("./a")>) { val; }
|
2018-06-20 01:36:18 +02:00
|
|
|
method() { this.x = import("./a"); }
|
|
|
|
}`,
|
|
|
|
});
|
|
|
|
|