Checks A and B are not equal.
A
B
type R = IsNotEqual<1, 1> // falsetype R = IsNotEqual<any, any> // falsetype R = IsNotEqual<boolean, boolean> // falsetype R = IsNotEqual<true, true> // falsetype R = IsNotEqual<[1], [1]> // falsetype R = IsNotEqual<boolean, true> // truetype R = IsNotEqual<any, 1> // truetype R = IsNotEqual<[any], [1]> // truetype R = IsNotEqual<{ a: 1 }, { a: 1; b: 2 }> // true Copy
type R = IsNotEqual<1, 1> // falsetype R = IsNotEqual<any, any> // falsetype R = IsNotEqual<boolean, boolean> // falsetype R = IsNotEqual<true, true> // falsetype R = IsNotEqual<[1], [1]> // falsetype R = IsNotEqual<boolean, true> // truetype R = IsNotEqual<any, 1> // truetype R = IsNotEqual<[any], [1]> // truetype R = IsNotEqual<{ a: 1 }, { a: 1; b: 2 }> // true
Note that intersection type checks only works at first level. It cannot be check recursively, or else will run into infinite recursion if the type includes recursive types.
Checks
A
andB
are not equal.Note that intersection type checks only works at first level. It cannot be check recursively, or else will run into infinite recursion if the type includes recursive types.