-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: LS: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbolHelp WantedYou can do thisYou can do this
Milestone
Description
Bug Report
🔎 Search Terms
quickfix missing properties generic parameter
🕗 Version & Regression Information
The quickfix was added in #44576 (cc @a-tarasyuk) but it doesn't appear to handle generic parameters.
💻 Code
interface Foo<T> {
foo(): T;
}
const x: Foo<string> = {};🙁 Actual behavior
The following is generated by the quickfix:
interface Foo<T> {
foo(): T;
}
const x: Foo<string> = {
foo: function (): T { // <-- this is wrong
throw new Error("Function not implemented.");
}
};🙂 Expected behavior
I would expect to see string instead of T:
interface Foo<T> {
foo(): T;
}
const x: Foo<string> = {
foo: function (): string {
throw new Error("Function not implemented.");
}
};Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: LS: Refactoringse.g. extract to constant or function, rename symbole.g. extract to constant or function, rename symbolHelp WantedYou can do thisYou can do this