Closed
Description
TypeScript Version: 4.0.0-dev.20200706
Search Terms: refactoring, abstract class, this, suggestions, intellisense,
Code
abstract class Thing {
abstract run(): void;
}
class ThingImpl extends Thing {
}
abstract class ThingWithThis {
abstract run(this: ThingWithThis): void;
}
class ThingWithThisImpl extends ThingWithThis {
}
Expected behavior:
Refactorings to auto implement ThingWithThisImpl as such:
abstract class Thing {
abstract run(): void;
}
class ThingImpl extends Thing {
run(): void {
throw new Error("Method not implemented.");
}
}
abstract class ThingWithThis {
abstract run(this: ThingWithThis): void;
}
class ThingWithThisImpl extends ThingWithThis {
run(this: ThingWithThis): void {
throw new Error("Method not implemented.");
}
}
Actual behavior:
Implementing the abstract class is not suggested for ThingWithThis.
Github doesn't support mp4s, so attached is a zip containing an mp4 of the problem if necessary.
problem.zip
Playground Link: [Playground Link](Playground Link)
Related Issues: N/A?