|
| 1 | +=== tests/cases/conformance/types/intersection/intersectionsAndEmptyObjects.ts === |
| 2 | +// Empty object type literals are removed from intersections types |
| 3 | +// that contain other object types |
| 4 | + |
| 5 | +type A = { a: number }; |
| 6 | +>A : Symbol(A, Decl(intersectionsAndEmptyObjects.ts, 0, 0)) |
| 7 | +>a : Symbol(a, Decl(intersectionsAndEmptyObjects.ts, 3, 10)) |
| 8 | + |
| 9 | +type B = { b: string }; |
| 10 | +>B : Symbol(B, Decl(intersectionsAndEmptyObjects.ts, 3, 23)) |
| 11 | +>b : Symbol(b, Decl(intersectionsAndEmptyObjects.ts, 4, 10)) |
| 12 | + |
| 13 | +type C = {}; |
| 14 | +>C : Symbol(C, Decl(intersectionsAndEmptyObjects.ts, 4, 23)) |
| 15 | + |
| 16 | +let x01: A & B; |
| 17 | +>x01 : Symbol(x01, Decl(intersectionsAndEmptyObjects.ts, 7, 3)) |
| 18 | +>A : Symbol(A, Decl(intersectionsAndEmptyObjects.ts, 0, 0)) |
| 19 | +>B : Symbol(B, Decl(intersectionsAndEmptyObjects.ts, 3, 23)) |
| 20 | + |
| 21 | +let x02: A & C; |
| 22 | +>x02 : Symbol(x02, Decl(intersectionsAndEmptyObjects.ts, 8, 3)) |
| 23 | +>A : Symbol(A, Decl(intersectionsAndEmptyObjects.ts, 0, 0)) |
| 24 | +>C : Symbol(C, Decl(intersectionsAndEmptyObjects.ts, 4, 23)) |
| 25 | + |
| 26 | +let x03: B & C; |
| 27 | +>x03 : Symbol(x03, Decl(intersectionsAndEmptyObjects.ts, 9, 3)) |
| 28 | +>B : Symbol(B, Decl(intersectionsAndEmptyObjects.ts, 3, 23)) |
| 29 | +>C : Symbol(C, Decl(intersectionsAndEmptyObjects.ts, 4, 23)) |
| 30 | + |
| 31 | +let x04: A & B & C; |
| 32 | +>x04 : Symbol(x04, Decl(intersectionsAndEmptyObjects.ts, 10, 3)) |
| 33 | +>A : Symbol(A, Decl(intersectionsAndEmptyObjects.ts, 0, 0)) |
| 34 | +>B : Symbol(B, Decl(intersectionsAndEmptyObjects.ts, 3, 23)) |
| 35 | +>C : Symbol(C, Decl(intersectionsAndEmptyObjects.ts, 4, 23)) |
| 36 | + |
| 37 | +let x05: string & C; |
| 38 | +>x05 : Symbol(x05, Decl(intersectionsAndEmptyObjects.ts, 11, 3)) |
| 39 | +>C : Symbol(C, Decl(intersectionsAndEmptyObjects.ts, 4, 23)) |
| 40 | + |
| 41 | +let x06: C & string; |
| 42 | +>x06 : Symbol(x06, Decl(intersectionsAndEmptyObjects.ts, 12, 3)) |
| 43 | +>C : Symbol(C, Decl(intersectionsAndEmptyObjects.ts, 4, 23)) |
| 44 | + |
| 45 | +let x07: C; |
| 46 | +>x07 : Symbol(x07, Decl(intersectionsAndEmptyObjects.ts, 13, 3)) |
| 47 | +>C : Symbol(C, Decl(intersectionsAndEmptyObjects.ts, 4, 23)) |
| 48 | + |
| 49 | +let x08: C & {}; |
| 50 | +>x08 : Symbol(x08, Decl(intersectionsAndEmptyObjects.ts, 14, 3)) |
| 51 | +>C : Symbol(C, Decl(intersectionsAndEmptyObjects.ts, 4, 23)) |
| 52 | + |
| 53 | +let x09: {} & A & {} & B & {} & C & {}; |
| 54 | +>x09 : Symbol(x09, Decl(intersectionsAndEmptyObjects.ts, 15, 3)) |
| 55 | +>A : Symbol(A, Decl(intersectionsAndEmptyObjects.ts, 0, 0)) |
| 56 | +>B : Symbol(B, Decl(intersectionsAndEmptyObjects.ts, 3, 23)) |
| 57 | +>C : Symbol(C, Decl(intersectionsAndEmptyObjects.ts, 4, 23)) |
| 58 | + |
| 59 | +interface D {} |
| 60 | +>D : Symbol(D, Decl(intersectionsAndEmptyObjects.ts, 15, 39)) |
| 61 | + |
| 62 | +interface E {} |
| 63 | +>E : Symbol(E, Decl(intersectionsAndEmptyObjects.ts, 17, 14)) |
| 64 | + |
| 65 | +let x10: A & D; |
| 66 | +>x10 : Symbol(x10, Decl(intersectionsAndEmptyObjects.ts, 20, 3)) |
| 67 | +>A : Symbol(A, Decl(intersectionsAndEmptyObjects.ts, 0, 0)) |
| 68 | +>D : Symbol(D, Decl(intersectionsAndEmptyObjects.ts, 15, 39)) |
| 69 | + |
| 70 | +let x11: C & D; |
| 71 | +>x11 : Symbol(x11, Decl(intersectionsAndEmptyObjects.ts, 21, 3)) |
| 72 | +>C : Symbol(C, Decl(intersectionsAndEmptyObjects.ts, 4, 23)) |
| 73 | +>D : Symbol(D, Decl(intersectionsAndEmptyObjects.ts, 15, 39)) |
| 74 | + |
| 75 | +let x12: A & B & C & D; |
| 76 | +>x12 : Symbol(x12, Decl(intersectionsAndEmptyObjects.ts, 22, 3)) |
| 77 | +>A : Symbol(A, Decl(intersectionsAndEmptyObjects.ts, 0, 0)) |
| 78 | +>B : Symbol(B, Decl(intersectionsAndEmptyObjects.ts, 3, 23)) |
| 79 | +>C : Symbol(C, Decl(intersectionsAndEmptyObjects.ts, 4, 23)) |
| 80 | +>D : Symbol(D, Decl(intersectionsAndEmptyObjects.ts, 15, 39)) |
| 81 | + |
| 82 | +let x13: D & E; |
| 83 | +>x13 : Symbol(x13, Decl(intersectionsAndEmptyObjects.ts, 23, 3)) |
| 84 | +>D : Symbol(D, Decl(intersectionsAndEmptyObjects.ts, 15, 39)) |
| 85 | +>E : Symbol(E, Decl(intersectionsAndEmptyObjects.ts, 17, 14)) |
| 86 | + |
| 87 | +let x14: A & B & C & D & E; |
| 88 | +>x14 : Symbol(x14, Decl(intersectionsAndEmptyObjects.ts, 24, 3)) |
| 89 | +>A : Symbol(A, Decl(intersectionsAndEmptyObjects.ts, 0, 0)) |
| 90 | +>B : Symbol(B, Decl(intersectionsAndEmptyObjects.ts, 3, 23)) |
| 91 | +>C : Symbol(C, Decl(intersectionsAndEmptyObjects.ts, 4, 23)) |
| 92 | +>D : Symbol(D, Decl(intersectionsAndEmptyObjects.ts, 15, 39)) |
| 93 | +>E : Symbol(E, Decl(intersectionsAndEmptyObjects.ts, 17, 14)) |
| 94 | + |
0 commit comments