TypeScript/tests/cases/fourslash/codeFixClassImplementClassMultipleSignatures1.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

23 lines
698 B
TypeScript

/// <reference path='fourslash.ts' />
////class A {
//// method(a: number, b: string): boolean;
//// method(a: string | number, b?: string | number): boolean | Function { return a + b as any; }
////}
////class C implements A {}
verify.codeFix({
description: "Implement interface 'A'",
newFileContent:
`class A {
method(a: number, b: string): boolean;
method(a: string | number, b?: string | number): boolean | Function { return a + b as any; }
}
class C implements A {
method(a: number, b: string): boolean;
method(a: string | number, b?: string | number): boolean | Function {
throw new Error("Method not implemented.");
}
}`,
});