|
| 1 | +=== tests/cases/conformance/types/intersection/intersectionReduction.ts === |
| 2 | +// @strict |
| 3 | + |
| 4 | +declare const sym1: unique symbol; |
| 5 | +>sym1 : Symbol(sym1, Decl(intersectionReduction.ts, 2, 13)) |
| 6 | + |
| 7 | +declare const sym2: unique symbol; |
| 8 | +>sym2 : Symbol(sym2, Decl(intersectionReduction.ts, 3, 13)) |
| 9 | + |
| 10 | +type T1 = string & 'a'; // 'a' |
| 11 | +>T1 : Symbol(T1, Decl(intersectionReduction.ts, 3, 34)) |
| 12 | + |
| 13 | +type T2 = 'a' & string & 'b'; // 'a' & 'b' |
| 14 | +>T2 : Symbol(T2, Decl(intersectionReduction.ts, 5, 23)) |
| 15 | + |
| 16 | +type T3 = number & 10; // 10 |
| 17 | +>T3 : Symbol(T3, Decl(intersectionReduction.ts, 6, 29)) |
| 18 | + |
| 19 | +type T4 = 10 & number & 20; // 10 & 20 |
| 20 | +>T4 : Symbol(T4, Decl(intersectionReduction.ts, 7, 22)) |
| 21 | + |
| 22 | +type T5 = symbol & typeof sym1; // typeof sym1 |
| 23 | +>T5 : Symbol(T5, Decl(intersectionReduction.ts, 8, 27)) |
| 24 | +>sym1 : Symbol(sym1, Decl(intersectionReduction.ts, 2, 13)) |
| 25 | + |
| 26 | +type T6 = typeof sym1 & symbol & typeof sym2; // typeof sym1 & typeof sym2 |
| 27 | +>T6 : Symbol(T6, Decl(intersectionReduction.ts, 9, 31)) |
| 28 | +>sym1 : Symbol(sym1, Decl(intersectionReduction.ts, 2, 13)) |
| 29 | +>sym2 : Symbol(sym2, Decl(intersectionReduction.ts, 3, 13)) |
| 30 | + |
| 31 | +type T7 = string & 'a' & number & 10 & symbol & typeof sym1; // 'a' & 10 & typeof sym1 |
| 32 | +>T7 : Symbol(T7, Decl(intersectionReduction.ts, 10, 45)) |
| 33 | +>sym1 : Symbol(sym1, Decl(intersectionReduction.ts, 2, 13)) |
| 34 | + |
| 35 | +type T10 = string & ('a' | 'b'); // 'a' | 'b' |
| 36 | +>T10 : Symbol(T10, Decl(intersectionReduction.ts, 11, 60)) |
| 37 | + |
| 38 | +type T11 = (string | number) & ('a' | 10); // 'a' | 10 |
| 39 | +>T11 : Symbol(T11, Decl(intersectionReduction.ts, 13, 32)) |
| 40 | + |
0 commit comments