We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 00c3015 commit e0d210dCopy full SHA for e0d210d
tests/cases/conformance/types/spread/objectSpread.ts
@@ -120,3 +120,24 @@ let a = 12;
120
let shortCutted: { a: number, b: string } = { ...o, a }
121
// non primitive
122
let spreadNonPrimitive = { ...<object>{}};
123
+
124
+// generic spreads
125
+function genericSpread<T, U>(t: T, u: U, v: T | U, w: T | { s: string }, obj: { x: number }) {
126
+ let x01 = { ...t };
127
+ let x02 = { ...t, ...t };
128
+ let x03 = { ...t, ...u };
129
+ let x04 = { ...u, ...t };
130
+ let x05 = { a: 5, b: 'hi', ...t };
131
+ let x06 = { ...t, a: 5, b: 'hi' };
132
+ let x07 = { a: 5, b: 'hi', ...t, c: true, ...obj };
133
+ let x09 = { a: 5, ...t, b: 'hi', c: true, ...obj };
134
+ let x10 = { a: 5, ...t, b: 'hi', ...u, ...obj };
135
+ let x11 = { ...v };
136
+ let x12 = { ...v, ...obj };
137
+ let x13 = { ...w };
138
+ let x14 = { ...w, ...obj };
139
+ let x15 = { ...t, ...v };
140
+ let x16 = { ...t, ...w };
141
+ let x17 = { ...t, ...w, ...obj };
142
+ let x18 = { ...t, ...v, ...w };
143
+}
0 commit comments