Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Missing properties quickfix does not handle generic parameters聽#47746

Copy link
Copy link

Description

@hpx7
Issue body actions

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.");
  }
};
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    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

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.