Closed
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.");
}
};