Closed
Description
Bug Report
π Search Terms
conditional tuple extend simplify type parameter constraint
π Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about conditional types
β― Playground Link
Playground link with relevant code
π» Code
type Bit = 0 | 1;
type And<A extends Bit, B extends Bit> = [A, B] extends [1, 1] ? 1 : 0;
type Test<A extends Bit, B extends Bit> = And<A extends 1 ? 0 : 1, B extends 1 ? 0 : 1>;
// ^? type Test<I1 extends Bit, I2 extends Bit> = 1
type a = Test<1, 1>; // 1, should be 0
π Actual behavior
Test<A, B>
is being incorrectly simplified to 1
before being called, and Test<1, 1>
is resolving incorrectly to 1
.
π Expected behavior
Test<A, B>
should not be simplified, and Test<1, 1>
should resolve to 0
.