|
| 1 | +//// [tests/cases/compiler/distributiveConditionalTypeNeverIntersection1.ts] //// |
| 2 | + |
| 3 | +=== distributiveConditionalTypeNeverIntersection1.ts === |
| 4 | +// https://github.com/microsoft/TypeScript/issues/57343 |
| 5 | + |
| 6 | +type IsNumber<T> = T extends number ? true : false; |
| 7 | +>IsNumber : Symbol(IsNumber, Decl(distributiveConditionalTypeNeverIntersection1.ts, 0, 0)) |
| 8 | +>T : Symbol(T, Decl(distributiveConditionalTypeNeverIntersection1.ts, 2, 14)) |
| 9 | +>T : Symbol(T, Decl(distributiveConditionalTypeNeverIntersection1.ts, 2, 14)) |
| 10 | + |
| 11 | +type Conflicted = { x: true } & { x: false }; |
| 12 | +>Conflicted : Symbol(Conflicted, Decl(distributiveConditionalTypeNeverIntersection1.ts, 2, 51)) |
| 13 | +>x : Symbol(x, Decl(distributiveConditionalTypeNeverIntersection1.ts, 4, 19)) |
| 14 | +>x : Symbol(x, Decl(distributiveConditionalTypeNeverIntersection1.ts, 4, 33)) |
| 15 | + |
| 16 | +type Ex1 = IsNumber<Conflicted>; // never |
| 17 | +>Ex1 : Symbol(Ex1, Decl(distributiveConditionalTypeNeverIntersection1.ts, 4, 45)) |
| 18 | +>IsNumber : Symbol(IsNumber, Decl(distributiveConditionalTypeNeverIntersection1.ts, 0, 0)) |
| 19 | +>Conflicted : Symbol(Conflicted, Decl(distributiveConditionalTypeNeverIntersection1.ts, 2, 51)) |
| 20 | + |
| 21 | +type Ex2 = IsNumber<"OEEE" | Conflicted>; // false |
| 22 | +>Ex2 : Symbol(Ex2, Decl(distributiveConditionalTypeNeverIntersection1.ts, 6, 32)) |
| 23 | +>IsNumber : Symbol(IsNumber, Decl(distributiveConditionalTypeNeverIntersection1.ts, 0, 0)) |
| 24 | +>Conflicted : Symbol(Conflicted, Decl(distributiveConditionalTypeNeverIntersection1.ts, 2, 51)) |
| 25 | + |
| 26 | +type Ex3 = IsNumber<1 | Conflicted>; // true |
| 27 | +>Ex3 : Symbol(Ex3, Decl(distributiveConditionalTypeNeverIntersection1.ts, 7, 41)) |
| 28 | +>IsNumber : Symbol(IsNumber, Decl(distributiveConditionalTypeNeverIntersection1.ts, 0, 0)) |
| 29 | +>Conflicted : Symbol(Conflicted, Decl(distributiveConditionalTypeNeverIntersection1.ts, 2, 51)) |
| 30 | + |
0 commit comments