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

Salsa type inference could pass through argument types #6668

Closed
egamma opened this issue Jan 27, 2016 · 3 comments
Closed

Salsa type inference could pass through argument types #6668

egamma opened this issue Jan 27, 2016 · 3 comments
Assignees

Comments

@egamma
Copy link
Member

egamma commented Jan 27, 2016

From @alexandrudima on January 27, 2016 10:54

Testing #2218

Would be nice if it knew the result is a string.

image

Copied from original issue: microsoft/vscode#2433

@billti
Copy link
Member

billti commented Jan 27, 2016

We are using the TypeScript inference system, and have no plans to add call-site inference at this point. (Or inferring a generic signature of the function). The param should be given a type via JsDoc (just as TypeScript params require a type to not be any).

If this become a major pain-point and source of feedback, we can revisit.

@billti billti closed this as completed Jan 27, 2016
@mhegazy
Copy link
Contributor

mhegazy commented Jan 28, 2016

If we decide to solve this, we should do some analysis on the type flow of inputs to outputs. if we can "detect" that the parameter types are manifested in the return type, and there were no type annotation (JSDoc), we should treat the function as generic.

@alexdima
Copy link
Member

Agreed, JSDoc should do the trick here, I just thought it would be a cool idea to infer generics too, but I'm totally fine with that being outside the scope. 👍

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants