I have this code of typescript
type X = (<T extends number | string>(a: T) => (b: T) => T)
const f: X = (a: any) => (b: any) => a + b
f(1)(2)
It showing error
Argument of type '2' is not assignable to parameter of type '1'.
The inferred type in the first argument is '1' but I want it to be number with same constraints on generics string | number.
The types of arguments passed can only be either number or string i.e. constrained to string | number.