TypeScript/tests/cases/fourslash/codeFixClassImplementInterfaceInheritsAbstractMethod.ts
Andy 24842b4002
When --noUnusedLocals/--noUnusedParameters is disabled, add suggestions instead of errors (#22361)
* When --noUnusedLocals/--noUnusedParameters is disabled, add suggestions instead of errors

* Improve performance: do not add unused suggestion diagnostics unless asking for a suggestion

* Add "unused" flag to diagnostics

* Code review

* reportsUnused -> reportsUnnecessary

* Fix test
2018-04-05 12:33:00 -07:00

24 lines
562 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/// <reference path='fourslash.ts' />
////abstract class C1 { }
////abstract class C2 {
//// abstract f<T extends number>(): T;
////}
////interface I1 extends C1, C2 { }
////class C3 implements I1 {[| |]}
verify.codeFix({
description: "Implement interface 'I1'",
newFileContent:
`abstract class C1 { }
abstract class C2 {
abstract f<T extends number>(): T;
}
interface I1 extends C1, C2 { }
class C3 implements I1 {
f<T extends number>(): T {
throw new Error("Method not implemented.");
}
}`,
});