Why do we need to manually type unified overload signatures? #25352
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
Please close if this has been asked before - nothing came up when searching.
Search Terms
overload, function, multiple, default, combine, unify, top
Suggestion
Today, when defining an overloaded call signature you have to manually type the implementation. Would it be possible to extend contextual types so TS can infer the implementation's types from context, just like TS already does for non-overloaded signatures?
Use Cases
Today, contextual typing isn't able to infer parameter types for overloaded call signatures. Instead, users have to manually type the implementation.
Examples
Before
After
Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: