1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188
|
=== tests/cases/conformance/types/spread/objectSpreadIntersection.ts ===
function iteratedUnionIntersection<T, U, V>(t: T, u: U, v: V): void {
>iteratedUnionIntersection : Symbol(iteratedUnionIntersection, Decl(objectSpreadIntersection.ts, 0, 0))
>T : Symbol(T, Decl(objectSpreadIntersection.ts, 0, 35))
>U : Symbol(U, Decl(objectSpreadIntersection.ts, 0, 37))
>V : Symbol(V, Decl(objectSpreadIntersection.ts, 0, 40))
>t : Symbol(t, Decl(objectSpreadIntersection.ts, 0, 44))
>T : Symbol(T, Decl(objectSpreadIntersection.ts, 0, 35))
>u : Symbol(u, Decl(objectSpreadIntersection.ts, 0, 49))
>U : Symbol(U, Decl(objectSpreadIntersection.ts, 0, 37))
>v : Symbol(v, Decl(objectSpreadIntersection.ts, 0, 55))
>V : Symbol(V, Decl(objectSpreadIntersection.ts, 0, 40))
let tu: T | U;
>tu : Symbol(tu, Decl(objectSpreadIntersection.ts, 1, 7))
>T : Symbol(T, Decl(objectSpreadIntersection.ts, 0, 35))
>U : Symbol(U, Decl(objectSpreadIntersection.ts, 0, 37))
let uv: U & V;
>uv : Symbol(uv, Decl(objectSpreadIntersection.ts, 2, 7))
>U : Symbol(U, Decl(objectSpreadIntersection.ts, 0, 37))
>V : Symbol(V, Decl(objectSpreadIntersection.ts, 0, 40))
let result = { ...tu, ...uv, id: 'foo' };
>result : Symbol(result, Decl(objectSpreadIntersection.ts, 3, 7))
>id : Symbol(id, Decl(objectSpreadIntersection.ts, 3, 32))
let assignable: { ...(T | U), ...(U & V), id: string } = result;
>assignable : Symbol(assignable, Decl(objectSpreadIntersection.ts, 4, 7))
>T : Symbol(T, Decl(objectSpreadIntersection.ts, 0, 35))
>U : Symbol(U, Decl(objectSpreadIntersection.ts, 0, 37))
>U : Symbol(U, Decl(objectSpreadIntersection.ts, 0, 37))
>V : Symbol(V, Decl(objectSpreadIntersection.ts, 0, 40))
>id : Symbol(id, Decl(objectSpreadIntersection.ts, 4, 45))
>result : Symbol(result, Decl(objectSpreadIntersection.ts, 3, 7))
}
// concrete types work
interface A1 { a: number }
>A1 : Symbol(A1, Decl(objectSpreadIntersection.ts, 5, 1))
>a : Symbol(A1.a, Decl(objectSpreadIntersection.ts, 7, 14))
interface A2 { a: string }
>A2 : Symbol(A2, Decl(objectSpreadIntersection.ts, 7, 26))
>a : Symbol(A2.a, Decl(objectSpreadIntersection.ts, 8, 14))
interface B1 { b: number }
>B1 : Symbol(B1, Decl(objectSpreadIntersection.ts, 8, 26))
>b : Symbol(B1.b, Decl(objectSpreadIntersection.ts, 9, 14))
interface B2 { b: string }
>B2 : Symbol(B2, Decl(objectSpreadIntersection.ts, 9, 26))
>b : Symbol(B2.b, Decl(objectSpreadIntersection.ts, 10, 14))
let a12: A1 & A2;
>a12 : Symbol(a12, Decl(objectSpreadIntersection.ts, 11, 3))
>A1 : Symbol(A1, Decl(objectSpreadIntersection.ts, 5, 1))
>A2 : Symbol(A2, Decl(objectSpreadIntersection.ts, 7, 26))
let b12: B1 & B2;
>b12 : Symbol(b12, Decl(objectSpreadIntersection.ts, 12, 3))
>B1 : Symbol(B1, Decl(objectSpreadIntersection.ts, 8, 26))
>B2 : Symbol(B2, Decl(objectSpreadIntersection.ts, 9, 26))
let result = { ...a12, ...b12 };
>result : Symbol(result, Decl(objectSpreadIntersection.ts, 13, 3))
let sn: number & string = result.a;
>sn : Symbol(sn, Decl(objectSpreadIntersection.ts, 14, 3))
>result.a : Symbol(a, Decl(objectSpreadIntersection.ts, 7, 14), Decl(objectSpreadIntersection.ts, 8, 14))
>result : Symbol(result, Decl(objectSpreadIntersection.ts, 13, 3))
>a : Symbol(a, Decl(objectSpreadIntersection.ts, 7, 14), Decl(objectSpreadIntersection.ts, 8, 14))
sn = result.b;
>sn : Symbol(sn, Decl(objectSpreadIntersection.ts, 14, 3))
>result.b : Symbol(b, Decl(objectSpreadIntersection.ts, 9, 14), Decl(objectSpreadIntersection.ts, 10, 14))
>result : Symbol(result, Decl(objectSpreadIntersection.ts, 13, 3))
>b : Symbol(b, Decl(objectSpreadIntersection.ts, 9, 14), Decl(objectSpreadIntersection.ts, 10, 14))
let assignable: { ...(A1 & A2), ...(B1 & B2) } = result;
>assignable : Symbol(assignable, Decl(objectSpreadIntersection.ts, 16, 3))
>A1 : Symbol(A1, Decl(objectSpreadIntersection.ts, 5, 1))
>A2 : Symbol(A2, Decl(objectSpreadIntersection.ts, 7, 26))
>B1 : Symbol(B1, Decl(objectSpreadIntersection.ts, 8, 26))
>B2 : Symbol(B2, Decl(objectSpreadIntersection.ts, 9, 26))
>result : Symbol(result, Decl(objectSpreadIntersection.ts, 13, 3))
function tripleIntersection<T, U, V>(t: T, u: U, v: V): void {
>tripleIntersection : Symbol(tripleIntersection, Decl(objectSpreadIntersection.ts, 16, 56))
>T : Symbol(T, Decl(objectSpreadIntersection.ts, 18, 28))
>U : Symbol(U, Decl(objectSpreadIntersection.ts, 18, 30))
>V : Symbol(V, Decl(objectSpreadIntersection.ts, 18, 33))
>t : Symbol(t, Decl(objectSpreadIntersection.ts, 18, 37))
>T : Symbol(T, Decl(objectSpreadIntersection.ts, 18, 28))
>u : Symbol(u, Decl(objectSpreadIntersection.ts, 18, 42))
>U : Symbol(U, Decl(objectSpreadIntersection.ts, 18, 30))
>v : Symbol(v, Decl(objectSpreadIntersection.ts, 18, 48))
>V : Symbol(V, Decl(objectSpreadIntersection.ts, 18, 33))
let tuv: T & U & V;
>tuv : Symbol(tuv, Decl(objectSpreadIntersection.ts, 19, 7))
>T : Symbol(T, Decl(objectSpreadIntersection.ts, 18, 28))
>U : Symbol(U, Decl(objectSpreadIntersection.ts, 18, 30))
>V : Symbol(V, Decl(objectSpreadIntersection.ts, 18, 33))
let result = { ...tuv, id: 'bar' };
>result : Symbol(result, Decl(objectSpreadIntersection.ts, 20, 7))
>id : Symbol(id, Decl(objectSpreadIntersection.ts, 20, 26))
let assignable: { ...(T & U & V), id: string } = result;
>assignable : Symbol(assignable, Decl(objectSpreadIntersection.ts, 21, 7))
>T : Symbol(T, Decl(objectSpreadIntersection.ts, 18, 28))
>U : Symbol(U, Decl(objectSpreadIntersection.ts, 18, 30))
>V : Symbol(V, Decl(objectSpreadIntersection.ts, 18, 33))
>id : Symbol(id, Decl(objectSpreadIntersection.ts, 21, 37))
>result : Symbol(result, Decl(objectSpreadIntersection.ts, 20, 7))
}
function iteratedDoubleIntersection<T, U, V>(t: T, u: U, v: V): void {
>iteratedDoubleIntersection : Symbol(iteratedDoubleIntersection, Decl(objectSpreadIntersection.ts, 22, 1))
>T : Symbol(T, Decl(objectSpreadIntersection.ts, 23, 36))
>U : Symbol(U, Decl(objectSpreadIntersection.ts, 23, 38))
>V : Symbol(V, Decl(objectSpreadIntersection.ts, 23, 41))
>t : Symbol(t, Decl(objectSpreadIntersection.ts, 23, 45))
>T : Symbol(T, Decl(objectSpreadIntersection.ts, 23, 36))
>u : Symbol(u, Decl(objectSpreadIntersection.ts, 23, 50))
>U : Symbol(U, Decl(objectSpreadIntersection.ts, 23, 38))
>v : Symbol(v, Decl(objectSpreadIntersection.ts, 23, 56))
>V : Symbol(V, Decl(objectSpreadIntersection.ts, 23, 41))
let tu: T & U;
>tu : Symbol(tu, Decl(objectSpreadIntersection.ts, 24, 7))
>T : Symbol(T, Decl(objectSpreadIntersection.ts, 23, 36))
>U : Symbol(U, Decl(objectSpreadIntersection.ts, 23, 38))
let uv: U & V;
>uv : Symbol(uv, Decl(objectSpreadIntersection.ts, 25, 7))
>U : Symbol(U, Decl(objectSpreadIntersection.ts, 23, 38))
>V : Symbol(V, Decl(objectSpreadIntersection.ts, 23, 41))
let result = { ...tu, ...uv, id: 'baz' };
>result : Symbol(result, Decl(objectSpreadIntersection.ts, 26, 7))
>id : Symbol(id, Decl(objectSpreadIntersection.ts, 26, 32))
let assignable: { ...(T & U), ...(U & V), id: string } = result;
>assignable : Symbol(assignable, Decl(objectSpreadIntersection.ts, 27, 7))
>T : Symbol(T, Decl(objectSpreadIntersection.ts, 23, 36))
>U : Symbol(U, Decl(objectSpreadIntersection.ts, 23, 38))
>U : Symbol(U, Decl(objectSpreadIntersection.ts, 23, 38))
>V : Symbol(V, Decl(objectSpreadIntersection.ts, 23, 41))
>id : Symbol(id, Decl(objectSpreadIntersection.ts, 27, 45))
>result : Symbol(result, Decl(objectSpreadIntersection.ts, 26, 7))
}
function iteratedIntersectionUnion<T, U, V>(t: T, u: U, v: V): void {
>iteratedIntersectionUnion : Symbol(iteratedIntersectionUnion, Decl(objectSpreadIntersection.ts, 28, 1))
>T : Symbol(T, Decl(objectSpreadIntersection.ts, 29, 35))
>U : Symbol(U, Decl(objectSpreadIntersection.ts, 29, 37))
>V : Symbol(V, Decl(objectSpreadIntersection.ts, 29, 40))
>t : Symbol(t, Decl(objectSpreadIntersection.ts, 29, 44))
>T : Symbol(T, Decl(objectSpreadIntersection.ts, 29, 35))
>u : Symbol(u, Decl(objectSpreadIntersection.ts, 29, 49))
>U : Symbol(U, Decl(objectSpreadIntersection.ts, 29, 37))
>v : Symbol(v, Decl(objectSpreadIntersection.ts, 29, 55))
>V : Symbol(V, Decl(objectSpreadIntersection.ts, 29, 40))
let tu: T & U;
>tu : Symbol(tu, Decl(objectSpreadIntersection.ts, 30, 7))
>T : Symbol(T, Decl(objectSpreadIntersection.ts, 29, 35))
>U : Symbol(U, Decl(objectSpreadIntersection.ts, 29, 37))
let uv: U | V;
>uv : Symbol(uv, Decl(objectSpreadIntersection.ts, 31, 7))
>U : Symbol(U, Decl(objectSpreadIntersection.ts, 29, 37))
>V : Symbol(V, Decl(objectSpreadIntersection.ts, 29, 40))
let result = { ...tu, ...uv, id: 'qux' };
>result : Symbol(result, Decl(objectSpreadIntersection.ts, 32, 7))
>id : Symbol(id, Decl(objectSpreadIntersection.ts, 32, 32))
let assignable: { ...(T & U), ...(U | V), id: string } = result;
>assignable : Symbol(assignable, Decl(objectSpreadIntersection.ts, 33, 7))
>T : Symbol(T, Decl(objectSpreadIntersection.ts, 29, 35))
>U : Symbol(U, Decl(objectSpreadIntersection.ts, 29, 37))
>U : Symbol(U, Decl(objectSpreadIntersection.ts, 29, 37))
>V : Symbol(V, Decl(objectSpreadIntersection.ts, 29, 40))
>id : Symbol(id, Decl(objectSpreadIntersection.ts, 33, 45))
>result : Symbol(result, Decl(objectSpreadIntersection.ts, 32, 7))
}
|