Closed as not planned
Description
π Search Terms
call signature, overloaded call
π Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about call signature
β― Playground Link
π» Code
interface Foo {
(x: 1): 2
(x: 2): 3
}
type CallSignature<T> = T extends (...p: infer P) => infer R ? (...p: P) => R : T
type WrongType = CallSignature<Foo> // (x: 2) => 3
π Actual behavior
The inferred type is not compatible with actual type
π Expected behavior
The inferred type should (at minimum) be compatible with actual type (ideally { (x: 1) => 2; (x: 2) => 3 }
).
Additional information about the issue
No response