Type inference for Function.call
return type on generic functions
#54319
Labels
Awaiting More Feedback
This means we'd like to hear from more people who would be helped by this feature
Suggestion
An idea for TypeScript
π Search Terms
type infer function call generic
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
Type inference of
genericEcho.call
return type failed even when all the argument types are known at call site.Of course explicitly hinting the return type would work but it's not good:
π Expected behavior
I would expect type inference of generic function return type to work if all arguments types are known.
I think #40179 is related but the example I provided here is much more common since it exists in standard library.
The text was updated successfully, but these errors were encountered: