Usually in TypeScript i define pretty complex types so I never get this problem but I can't find an easy way to solve it.
type first = number;
type second = number;
let f: first = 1;
let s: second = 2;
const func = (arg1: first, arg2: second) => { };
func(s, f);
I expect to get an error from this code because I define the function with a first argument of type "first" and the second one of type "second" but when I call it I pass two arguments of inverted types
number. That's whyfirstandsecondare compatible.