Skip to content

Commit 7b322fd

Browse files
committed
fix(39440): show QF for abstract classes with methods which include 'this' parameter
1 parent 8c6b858 commit 7b322fd

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/cases/fourslash/codeFixAmbientClassExtendAbstractMethod.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,27 @@
55
//// abstract f(a: number, b: string): this;
66
//// abstract f(a: string, b: number): Function;
77
//// abstract f(a: string): Function;
8+
////
9+
//// abstract f1(this: A): number;
10+
//// abstract f2(this: A, a: number, b: string): number;
11+
////
812
//// abstract foo(): number;
913
////}
1014
////
1115
////declare class C extends A {}
1216

1317
verify.codeFix({
14-
description: "Implement inherited abstract class",
18+
description: ts.Diagnostics.Implement_inherited_abstract_class.message,
1519
newFileContent:
1620
`abstract class A {
1721
abstract f(a: number, b: string): boolean;
1822
abstract f(a: number, b: string): this;
1923
abstract f(a: string, b: number): Function;
2024
abstract f(a: string): Function;
25+
26+
abstract f1(this: A): number;
27+
abstract f2(this: A, a: number, b: string): number;
28+
2129
abstract foo(): number;
2230
}
2331
@@ -26,6 +34,8 @@ declare class C extends A {
2634
f(a: number, b: string): this;
2735
f(a: string, b: number): Function;
2836
f(a: string): Function;
37+
f1(this: A): number;
38+
f2(this: A, a: number, b: string): number;
2939
foo(): number;
3040
}`
3141
});

0 commit comments

Comments
 (0)