Skip to content

False positive for convert function to ES6 class #22240

Closed
@ghost

Description

TypeScript Version: 2.8.0-dev.20180228

Code

function f() {}
f.prototype.bar = function(){
    this.x = 1;
};

Highlight the second function keyword. You will get a suggestion to convert it to an ES6 class -- actually attempting to apply the suggestion does not work.
This happens because apparently the function expression has a non-empty .members containing x.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: Quick FixesEditor-provided fixes, often called code actions.FixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions