TypeScript/tests/cases/fourslash/codeFixClassImplementClassAbstractGettersAndSetters.ts
Ron Buckton 98b6db81d9
Allow accessors in ambient class declarations (#32787)
* Allow accessors in ambient class declarations

* Update src/compiler/transformers/declarations.ts

Co-Authored-By: Wesley Wigham <wewigham@microsoft.com>
2019-08-09 16:11:25 -07:00

41 lines
922 B
TypeScript

/// <reference path='fourslash.ts' />
////abstract class A {
//// abstract get a(): string;
//// abstract set a(newName: string);
////
//// abstract get b(): number;
////
//// abstract set c(arg: number | string);
////}
////
////class C implements A {}
verify.codeFix({
description: "Implement interface 'A'",
newFileContent:
`abstract class A {
abstract get a(): string;
abstract set a(newName: string);
abstract get b(): number;
abstract set c(arg: number | string);
}
class C implements A {
get a(): string {
throw new Error("Method not implemented.");
}
set a(newName: string) {
throw new Error("Method not implemented.");
}
get b(): number {
throw new Error("Method not implemented.");
}
set c(arg: string | number) {
throw new Error("Method not implemented.");
}
}`,
});