2020-04-13 19:23:12 +02:00
|
|
|
/// <reference path='fourslash.ts' />
|
|
|
|
|
|
|
|
// @Filename: a.ts
|
|
|
|
////export interface A {
|
|
|
|
//// x: number;
|
|
|
|
////}
|
|
|
|
|
|
|
|
// @Filename: b.ts
|
|
|
|
////import { A } from "./a";
|
|
|
|
////export interface B<T> {
|
|
|
|
//// payload: T;
|
|
|
|
////}
|
|
|
|
////export function create(fn: (args: B<A>) => void) {}
|
|
|
|
|
|
|
|
// @Filename: c.ts
|
|
|
|
////import { create } from "./b";
|
|
|
|
////class C {
|
|
|
|
//// bar() {
|
|
|
|
//// create(args => this.foo(args));
|
|
|
|
//// }
|
|
|
|
////}
|
|
|
|
|
|
|
|
goTo.file("c.ts");
|
|
|
|
verify.codeFix({
|
|
|
|
description: [ts.Diagnostics.Declare_method_0.message, "foo"],
|
|
|
|
index: 0,
|
|
|
|
newFileContent:
|
2020-07-09 00:25:04 +02:00
|
|
|
`import { A } from "./a";
|
|
|
|
import { B, create } from "./b";
|
2020-04-13 19:23:12 +02:00
|
|
|
class C {
|
|
|
|
bar() {
|
|
|
|
create(args => this.foo(args));
|
|
|
|
}
|
|
|
|
foo(args: B<A>): void {
|
|
|
|
throw new Error("Method not implemented.");
|
|
|
|
}
|
|
|
|
}`
|
|
|
|
});
|