TypeScript/tests/cases/fourslash/codeFixInferFromUsageSetterWithInaccessibleTypeJS.ts
Nathan Shively-Sanders ce85ee5115
Move infer-from-usage earlier in codefix list (#28318)
This makes it appear before the ts-ignore codefix, specifically.
2018-11-02 15:39:27 -07:00

37 lines
728 B
TypeScript

/// <reference path='fourslash.ts' />
// @allowJs: true
// @checkJs: true
// @noEmit: true
// @noImplicitAny: true
// @Filename: /promise.d.ts
////interface Promise<T> {
////}
////declare var Promise: Promise<any>;
// @Filename: /a.js
////export class D {}
////export default new D();
// @Filename: /b.js
////export class C {
//// set [|x|](val) { val; }
//// method() { this.x = import("./a"); }
////}
goTo.file("/b.js");
verify.codeFix({
index: 0,
description: "Infer type of 'x' from usage",
newFileContent:
`export class C {
/**
* @param {Promise<typeof import("./a")>} val
*/
set x(val) { val; }
method() { this.x = import("./a"); }
}`,
});