TypeScript/tests/cases/fourslash/codeFixClassImplementInterfaceMethodTypePredicate.ts

26 lines
464 B
TypeScript
Raw Normal View History

2017-03-27 20:53:44 +02:00
/// <reference path='fourslash.ts' />
////interface I {
//// f(i: any): i is I;
//// f(): this is I;
////}
////
////class C implements I {}
2017-03-27 20:53:44 +02:00
verify.codeFix({
description: "Implement interface 'I'",
newFileContent:
`interface I {
f(i: any): i is I;
f(): this is I;
2017-03-27 20:53:44 +02:00
}
2018-01-12 02:43:27 +01:00
class C implements I {
f(i: any): i is I;
f(): this is I;
f(i?: any) {
throw new Error("Method not implemented.");
}
}`,
});