Skip to content

False positive for convert function to ES6 class #22240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Feb 28, 2018 · 0 comments
Closed

False positive for convert function to ES6 class #22240

ghost opened this issue Feb 28, 2018 · 0 comments
Labels
Bug A bug in TypeScript Domain: Quick Fixes Editor-provided fixes, often called code actions. Fixed A PR has been merged for this issue

Comments

@ghost
Copy link

ghost commented Feb 28, 2018

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.

@mhegazy mhegazy added Bug A bug in TypeScript Domain: Quick Fixes Editor-provided fixes, often called code actions. labels Mar 1, 2018
@mhegazy mhegazy assigned ghost Mar 1, 2018
@ghost ghost closed this as completed in #22643 Mar 16, 2018
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Mar 28, 2018
@mhegazy mhegazy added this to the TypeScript 2.9 milestone Mar 28, 2018
@microsoft microsoft locked and limited conversation to collaborators Jul 25, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Domain: Quick Fixes Editor-provided fixes, often called code actions. Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

1 participant