mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
fix(39440): show QF for abstract classes with methods which include 'this' parameter (#39465)
This commit is contained in:
@@ -5,19 +5,27 @@
|
||||
//// abstract f(a: number, b: string): this;
|
||||
//// abstract f(a: string, b: number): Function;
|
||||
//// abstract f(a: string): Function;
|
||||
////
|
||||
//// abstract f1(this: A): number;
|
||||
//// abstract f2(this: A, a: number, b: string): number;
|
||||
////
|
||||
//// abstract foo(): number;
|
||||
////}
|
||||
////
|
||||
////declare class C extends A {}
|
||||
|
||||
verify.codeFix({
|
||||
description: "Implement inherited abstract class",
|
||||
description: ts.Diagnostics.Implement_inherited_abstract_class.message,
|
||||
newFileContent:
|
||||
`abstract class A {
|
||||
abstract f(a: number, b: string): boolean;
|
||||
abstract f(a: number, b: string): this;
|
||||
abstract f(a: string, b: number): Function;
|
||||
abstract f(a: string): Function;
|
||||
|
||||
abstract f1(this: A): number;
|
||||
abstract f2(this: A, a: number, b: string): number;
|
||||
|
||||
abstract foo(): number;
|
||||
}
|
||||
|
||||
@@ -26,6 +34,8 @@ declare class C extends A {
|
||||
f(a: number, b: string): this;
|
||||
f(a: string, b: number): Function;
|
||||
f(a: string): Function;
|
||||
f1(this: A): number;
|
||||
f2(this: A, a: number, b: string): number;
|
||||
foo(): number;
|
||||
}`
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user