Skip to content
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

Anonymous function expressions aren't covered for 'infer from usage' #19313

Open
DanielRosenwasser opened this issue Oct 18, 2017 · 0 comments
Open
Labels
Bug A bug in TypeScript Domain: Quick Fixes Editor-provided fixes, often called code actions.
Milestone

Comments

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Oct 18, 2017

I'm not getting any codefixes on the parameters in the following example:

var f = function(x, y, z) {
    return 0 + x + y + z;
}

f(1, 2, 3)

At the very least, x, y, and z should infer from their bodies.

Optimally, we should climb up looking for PropertyAssignments, PropertyDeclarations, and BinaryExpressions (with = tokens), and VariableDeclarations. For those, we should find all references and figure out the type there.

Should also test for default exports as well.

@DanielRosenwasser DanielRosenwasser added Bug A bug in TypeScript Domain: Quick Fixes Editor-provided fixes, often called code actions. labels Oct 18, 2017
@mhegazy mhegazy self-assigned this Oct 18, 2017
@mhegazy mhegazy added this to the TypeScript 2.6.2 milestone Oct 18, 2017
@mhegazy mhegazy modified the milestones: TypeScript 2.7, TypeScript 2.8 Jan 9, 2018
@mhegazy mhegazy added Domain: Quick Fixes Editor-provided fixes, often called code actions. and removed Domain: Quick Fixes Editor-provided fixes, often called code actions. labels Feb 12, 2018
@mhegazy mhegazy modified the milestones: TypeScript 2.8, TypeScript 2.9 Mar 9, 2018
@mhegazy mhegazy modified the milestones: TypeScript 3.0, Future Jul 2, 2018
@sandersn sandersn removed their assignment Jan 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Quick Fixes Editor-provided fixes, often called code actions.
Projects
None yet
Development

No branches or pull requests

3 participants