TypeScript/tests/cases/fourslash/codeFixClassImplementInterfaceMultipleSignaturesRest1.ts

29 lines
750 B
TypeScript
Raw Normal View History

2016-12-09 03:34:35 +01:00
/// <reference path='fourslash.ts' />
////interface I {
//// method(a: number, ...b: string[]): boolean;
//// method(a: string, ...b: number[]): Function;
//// method(a: string): Function;
////}
2016-12-09 03:34:35 +01:00
////
////class C implements I {}
2016-12-09 03:34:35 +01:00
verify.codeFix({
description: "Implement interface 'I'",
newFileContent:
`interface I {
2016-12-09 03:34:35 +01:00
method(a: number, ...b: string[]): boolean;
method(a: string, ...b: number[]): Function;
method(a: string): Function;
}
2018-01-12 02:43:27 +01:00
class C implements I {
method(a: number, ...b: string[]): boolean;
method(a: string, ...b: number[]): Function;
method(a: string): Function;
method(a: any, ...b?: any[]) {
throw new Error("Method not implemented.");
}
}`,
});