2016-12-07 04:46:08 +01:00
|
|
|
/// <reference path='fourslash.ts' />
|
|
|
|
|
2017-12-07 21:14:18 +01:00
|
|
|
////class A {
|
|
|
|
//// method(a: any, b: string): boolean;
|
|
|
|
//// method(a: string, b: number): Function;
|
|
|
|
//// method(a: string): Function;
|
2018-04-05 21:33:00 +02:00
|
|
|
//// method(a: string | number, b?: string | number): boolean | Function { return a + b as any; }
|
2017-12-07 21:14:18 +01:00
|
|
|
////}
|
2018-04-26 17:00:38 +02:00
|
|
|
////class C implements A { }
|
2016-12-07 04:46:08 +01:00
|
|
|
|
2017-12-07 21:14:18 +01:00
|
|
|
verify.codeFix({
|
|
|
|
description: "Implement interface 'A'",
|
|
|
|
newFileContent:
|
|
|
|
`class A {
|
2016-12-07 04:46:08 +01:00
|
|
|
method(a: any, b: string): boolean;
|
|
|
|
method(a: string, b: number): Function;
|
|
|
|
method(a: string): Function;
|
2018-04-05 21:33:00 +02:00
|
|
|
method(a: string | number, b?: string | number): boolean | Function { return a + b as any; }
|
2017-12-07 21:14:18 +01:00
|
|
|
}
|
2018-01-12 02:43:27 +01:00
|
|
|
class C implements A {
|
|
|
|
method(a: any, b: string): boolean;
|
|
|
|
method(a: string, b: number): Function;
|
|
|
|
method(a: string): Function;
|
|
|
|
method(a: string | number, b?: string | number): boolean | Function {
|
|
|
|
throw new Error("Method not implemented.");
|
|
|
|
}
|
2017-12-07 21:14:18 +01:00
|
|
|
}`,
|
|
|
|
});
|