You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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. 👍
From @alexandrudima on January 27, 2016 10:54
Testing #2218
Would be nice if it knew the result is a string.
Copied from original issue: microsoft/vscode#2433
The text was updated successfully, but these errors were encountered: