-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Quick FixesEditor-provided fixes, often called code actions.Editor-provided fixes, often called code actions.FixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
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?
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Quick FixesEditor-provided fixes, often called code actions.Editor-provided fixes, often called code actions.FixedA PR has been merged for this issueA PR has been merged for this issue