Skip to content

Commit 0f308f5

Browse files
committed
Accept new baselines
1 parent e0d210d commit 0f308f5

File tree

3 files changed

+291
-0
lines changed

3 files changed

+291
-0
lines changed

tests/baselines/reference/objectSpread.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,27 @@ let a = 12;
119119
let shortCutted: { a: number, b: string } = { ...o, a }
120120
// non primitive
121121
let spreadNonPrimitive = { ...<object>{}};
122+
123+
// generic spreads
124+
function genericSpread<T, U>(t: T, u: U, v: T | U, w: T | { s: string }, obj: { x: number }) {
125+
let x01 = { ...t };
126+
let x02 = { ...t, ...t };
127+
let x03 = { ...t, ...u };
128+
let x04 = { ...u, ...t };
129+
let x05 = { a: 5, b: 'hi', ...t };
130+
let x06 = { ...t, a: 5, b: 'hi' };
131+
let x07 = { a: 5, b: 'hi', ...t, c: true, ...obj };
132+
let x09 = { a: 5, ...t, b: 'hi', c: true, ...obj };
133+
let x10 = { a: 5, ...t, b: 'hi', ...u, ...obj };
134+
let x11 = { ...v };
135+
let x12 = { ...v, ...obj };
136+
let x13 = { ...w };
137+
let x14 = { ...w, ...obj };
138+
let x15 = { ...t, ...v };
139+
let x16 = { ...t, ...w };
140+
let x17 = { ...t, ...w, ...obj };
141+
let x18 = { ...t, ...v, ...w };
142+
}
122143

123144

124145
//// [objectSpread.js]
@@ -214,3 +235,23 @@ var a = 12;
214235
var shortCutted = __assign({}, o, { a: a });
215236
// non primitive
216237
var spreadNonPrimitive = __assign({}, {});
238+
// generic spreads
239+
function genericSpread(t, u, v, w, obj) {
240+
var x01 = __assign({}, t);
241+
var x02 = __assign({}, t, t);
242+
var x03 = __assign({}, t, u);
243+
var x04 = __assign({}, u, t);
244+
var x05 = __assign({ a: 5, b: 'hi' }, t);
245+
var x06 = __assign({}, t, { a: 5, b: 'hi' });
246+
var x07 = __assign({ a: 5, b: 'hi' }, t, { c: true }, obj);
247+
var x09 = __assign({ a: 5 }, t, { b: 'hi', c: true }, obj);
248+
var x10 = __assign({ a: 5 }, t, { b: 'hi' }, u, obj);
249+
var x11 = __assign({}, v);
250+
var x12 = __assign({}, v, obj);
251+
var x13 = __assign({}, w);
252+
var x14 = __assign({}, w, obj);
253+
var x15 = __assign({}, t, v);
254+
var x16 = __assign({}, t, w);
255+
var x17 = __assign({}, t, w, obj);
256+
var x18 = __assign({}, t, v, w);
257+
}

tests/baselines/reference/objectSpread.symbols

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,3 +452,117 @@ let shortCutted: { a: number, b: string } = { ...o, a }
452452
let spreadNonPrimitive = { ...<object>{}};
453453
>spreadNonPrimitive : Symbol(spreadNonPrimitive, Decl(objectSpread.ts, 119, 3))
454454

455+
// generic spreads
456+
function genericSpread<T, U>(t: T, u: U, v: T | U, w: T | { s: string }, obj: { x: number }) {
457+
>genericSpread : Symbol(genericSpread, Decl(objectSpread.ts, 119, 42))
458+
>T : Symbol(T, Decl(objectSpread.ts, 122, 23))
459+
>U : Symbol(U, Decl(objectSpread.ts, 122, 25))
460+
>t : Symbol(t, Decl(objectSpread.ts, 122, 29))
461+
>T : Symbol(T, Decl(objectSpread.ts, 122, 23))
462+
>u : Symbol(u, Decl(objectSpread.ts, 122, 34))
463+
>U : Symbol(U, Decl(objectSpread.ts, 122, 25))
464+
>v : Symbol(v, Decl(objectSpread.ts, 122, 40))
465+
>T : Symbol(T, Decl(objectSpread.ts, 122, 23))
466+
>U : Symbol(U, Decl(objectSpread.ts, 122, 25))
467+
>w : Symbol(w, Decl(objectSpread.ts, 122, 50))
468+
>T : Symbol(T, Decl(objectSpread.ts, 122, 23))
469+
>s : Symbol(s, Decl(objectSpread.ts, 122, 59))
470+
>obj : Symbol(obj, Decl(objectSpread.ts, 122, 72))
471+
>x : Symbol(x, Decl(objectSpread.ts, 122, 79))
472+
473+
let x01 = { ...t };
474+
>x01 : Symbol(x01, Decl(objectSpread.ts, 123, 7))
475+
>t : Symbol(t, Decl(objectSpread.ts, 122, 29))
476+
477+
let x02 = { ...t, ...t };
478+
>x02 : Symbol(x02, Decl(objectSpread.ts, 124, 7))
479+
>t : Symbol(t, Decl(objectSpread.ts, 122, 29))
480+
>t : Symbol(t, Decl(objectSpread.ts, 122, 29))
481+
482+
let x03 = { ...t, ...u };
483+
>x03 : Symbol(x03, Decl(objectSpread.ts, 125, 7))
484+
>t : Symbol(t, Decl(objectSpread.ts, 122, 29))
485+
>u : Symbol(u, Decl(objectSpread.ts, 122, 34))
486+
487+
let x04 = { ...u, ...t };
488+
>x04 : Symbol(x04, Decl(objectSpread.ts, 126, 7))
489+
>u : Symbol(u, Decl(objectSpread.ts, 122, 34))
490+
>t : Symbol(t, Decl(objectSpread.ts, 122, 29))
491+
492+
let x05 = { a: 5, b: 'hi', ...t };
493+
>x05 : Symbol(x05, Decl(objectSpread.ts, 127, 7))
494+
>a : Symbol(a, Decl(objectSpread.ts, 127, 15))
495+
>b : Symbol(b, Decl(objectSpread.ts, 127, 21))
496+
>t : Symbol(t, Decl(objectSpread.ts, 122, 29))
497+
498+
let x06 = { ...t, a: 5, b: 'hi' };
499+
>x06 : Symbol(x06, Decl(objectSpread.ts, 128, 7))
500+
>t : Symbol(t, Decl(objectSpread.ts, 122, 29))
501+
>a : Symbol(a, Decl(objectSpread.ts, 128, 21))
502+
>b : Symbol(b, Decl(objectSpread.ts, 128, 27))
503+
504+
let x07 = { a: 5, b: 'hi', ...t, c: true, ...obj };
505+
>x07 : Symbol(x07, Decl(objectSpread.ts, 129, 7))
506+
>a : Symbol(a, Decl(objectSpread.ts, 129, 15))
507+
>b : Symbol(b, Decl(objectSpread.ts, 129, 21))
508+
>t : Symbol(t, Decl(objectSpread.ts, 122, 29))
509+
>c : Symbol(c, Decl(objectSpread.ts, 129, 36))
510+
>obj : Symbol(obj, Decl(objectSpread.ts, 122, 72))
511+
512+
let x09 = { a: 5, ...t, b: 'hi', c: true, ...obj };
513+
>x09 : Symbol(x09, Decl(objectSpread.ts, 130, 7))
514+
>a : Symbol(a, Decl(objectSpread.ts, 130, 15))
515+
>t : Symbol(t, Decl(objectSpread.ts, 122, 29))
516+
>b : Symbol(b, Decl(objectSpread.ts, 130, 27))
517+
>c : Symbol(c, Decl(objectSpread.ts, 130, 36))
518+
>obj : Symbol(obj, Decl(objectSpread.ts, 122, 72))
519+
520+
let x10 = { a: 5, ...t, b: 'hi', ...u, ...obj };
521+
>x10 : Symbol(x10, Decl(objectSpread.ts, 131, 7))
522+
>a : Symbol(a, Decl(objectSpread.ts, 131, 15))
523+
>t : Symbol(t, Decl(objectSpread.ts, 122, 29))
524+
>b : Symbol(b, Decl(objectSpread.ts, 131, 27))
525+
>u : Symbol(u, Decl(objectSpread.ts, 122, 34))
526+
>obj : Symbol(obj, Decl(objectSpread.ts, 122, 72))
527+
528+
let x11 = { ...v };
529+
>x11 : Symbol(x11, Decl(objectSpread.ts, 132, 7))
530+
>v : Symbol(v, Decl(objectSpread.ts, 122, 40))
531+
532+
let x12 = { ...v, ...obj };
533+
>x12 : Symbol(x12, Decl(objectSpread.ts, 133, 7))
534+
>v : Symbol(v, Decl(objectSpread.ts, 122, 40))
535+
>obj : Symbol(obj, Decl(objectSpread.ts, 122, 72))
536+
537+
let x13 = { ...w };
538+
>x13 : Symbol(x13, Decl(objectSpread.ts, 134, 7))
539+
>w : Symbol(w, Decl(objectSpread.ts, 122, 50))
540+
541+
let x14 = { ...w, ...obj };
542+
>x14 : Symbol(x14, Decl(objectSpread.ts, 135, 7))
543+
>w : Symbol(w, Decl(objectSpread.ts, 122, 50))
544+
>obj : Symbol(obj, Decl(objectSpread.ts, 122, 72))
545+
546+
let x15 = { ...t, ...v };
547+
>x15 : Symbol(x15, Decl(objectSpread.ts, 136, 7))
548+
>t : Symbol(t, Decl(objectSpread.ts, 122, 29))
549+
>v : Symbol(v, Decl(objectSpread.ts, 122, 40))
550+
551+
let x16 = { ...t, ...w };
552+
>x16 : Symbol(x16, Decl(objectSpread.ts, 137, 7))
553+
>t : Symbol(t, Decl(objectSpread.ts, 122, 29))
554+
>w : Symbol(w, Decl(objectSpread.ts, 122, 50))
555+
556+
let x17 = { ...t, ...w, ...obj };
557+
>x17 : Symbol(x17, Decl(objectSpread.ts, 138, 7))
558+
>t : Symbol(t, Decl(objectSpread.ts, 122, 29))
559+
>w : Symbol(w, Decl(objectSpread.ts, 122, 50))
560+
>obj : Symbol(obj, Decl(objectSpread.ts, 122, 72))
561+
562+
let x18 = { ...t, ...v, ...w };
563+
>x18 : Symbol(x18, Decl(objectSpread.ts, 139, 7))
564+
>t : Symbol(t, Decl(objectSpread.ts, 122, 29))
565+
>v : Symbol(v, Decl(objectSpread.ts, 122, 40))
566+
>w : Symbol(w, Decl(objectSpread.ts, 122, 50))
567+
}
568+

tests/baselines/reference/objectSpread.types

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,3 +578,139 @@ let spreadNonPrimitive = { ...<object>{}};
578578
><object>{} : object
579579
>{} : {}
580580

581+
// generic spreads
582+
function genericSpread<T, U>(t: T, u: U, v: T | U, w: T | { s: string }, obj: { x: number }) {
583+
>genericSpread : <T, U>(t: T, u: U, v: T | U, w: T | { s: string; }, obj: { x: number; }) => void
584+
>t : T
585+
>u : U
586+
>v : T | U
587+
>w : T | { s: string; }
588+
>s : string
589+
>obj : { x: number; }
590+
>x : number
591+
592+
let x01 = { ...t };
593+
>x01 : T
594+
>{ ...t } : T
595+
>t : T
596+
597+
let x02 = { ...t, ...t };
598+
>x02 : T
599+
>{ ...t, ...t } : T
600+
>t : T
601+
>t : T
602+
603+
let x03 = { ...t, ...u };
604+
>x03 : T & U
605+
>{ ...t, ...u } : T & U
606+
>t : T
607+
>u : U
608+
609+
let x04 = { ...u, ...t };
610+
>x04 : U & T
611+
>{ ...u, ...t } : U & T
612+
>u : U
613+
>t : T
614+
615+
let x05 = { a: 5, b: 'hi', ...t };
616+
>x05 : { a: number; b: string; } & T
617+
>{ a: 5, b: 'hi', ...t } : { a: number; b: string; } & T
618+
>a : number
619+
>5 : 5
620+
>b : string
621+
>'hi' : "hi"
622+
>t : T
623+
624+
let x06 = { ...t, a: 5, b: 'hi' };
625+
>x06 : T & { a: number; b: string; }
626+
>{ ...t, a: 5, b: 'hi' } : T & { a: number; b: string; }
627+
>t : T
628+
>a : number
629+
>5 : 5
630+
>b : string
631+
>'hi' : "hi"
632+
633+
let x07 = { a: 5, b: 'hi', ...t, c: true, ...obj };
634+
>x07 : { a: number; b: string; } & T & { x: number; c: boolean; }
635+
>{ a: 5, b: 'hi', ...t, c: true, ...obj } : { a: number; b: string; } & T & { x: number; c: boolean; }
636+
>a : number
637+
>5 : 5
638+
>b : string
639+
>'hi' : "hi"
640+
>t : T
641+
>c : boolean
642+
>true : true
643+
>obj : { x: number; }
644+
645+
let x09 = { a: 5, ...t, b: 'hi', c: true, ...obj };
646+
>x09 : { a: number; } & T & { x: number; b: string; c: boolean; }
647+
>{ a: 5, ...t, b: 'hi', c: true, ...obj } : { a: number; } & T & { x: number; b: string; c: boolean; }
648+
>a : number
649+
>5 : 5
650+
>t : T
651+
>b : string
652+
>'hi' : "hi"
653+
>c : boolean
654+
>true : true
655+
>obj : { x: number; }
656+
657+
let x10 = { a: 5, ...t, b: 'hi', ...u, ...obj };
658+
>x10 : { a: number; } & T & { b: string; } & U & { x: number; }
659+
>{ a: 5, ...t, b: 'hi', ...u, ...obj } : { a: number; } & T & { b: string; } & U & { x: number; }
660+
>a : number
661+
>5 : 5
662+
>t : T
663+
>b : string
664+
>'hi' : "hi"
665+
>u : U
666+
>obj : { x: number; }
667+
668+
let x11 = { ...v };
669+
>x11 : T | U
670+
>{ ...v } : T | U
671+
>v : T | U
672+
673+
let x12 = { ...v, ...obj };
674+
>x12 : (T & { x: number; }) | (U & { x: number; })
675+
>{ ...v, ...obj } : (T & { x: number; }) | (U & { x: number; })
676+
>v : T | U
677+
>obj : { x: number; }
678+
679+
let x13 = { ...w };
680+
>x13 : T | { s: string; }
681+
>{ ...w } : T | { s: string; }
682+
>w : T | { s: string; }
683+
684+
let x14 = { ...w, ...obj };
685+
>x14 : (T & { x: number; }) | { x: number; s: string; }
686+
>{ ...w, ...obj } : (T & { x: number; }) | { x: number; s: string; }
687+
>w : T | { s: string; }
688+
>obj : { x: number; }
689+
690+
let x15 = { ...t, ...v };
691+
>x15 : T | (T & U)
692+
>{ ...t, ...v } : T | (T & U)
693+
>t : T
694+
>v : T | U
695+
696+
let x16 = { ...t, ...w };
697+
>x16 : T | (T & { s: string; })
698+
>{ ...t, ...w } : T | (T & { s: string; })
699+
>t : T
700+
>w : T | { s: string; }
701+
702+
let x17 = { ...t, ...w, ...obj };
703+
>x17 : (T & { x: number; }) | (T & { x: number; s: string; })
704+
>{ ...t, ...w, ...obj } : (T & { x: number; }) | (T & { x: number; s: string; })
705+
>t : T
706+
>w : T | { s: string; }
707+
>obj : { x: number; }
708+
709+
let x18 = { ...t, ...v, ...w };
710+
>x18 : T | (T & U) | (T & { s: string; }) | (T & U & { s: string; })
711+
>{ ...t, ...v, ...w } : T | (T & U) | (T & { s: string; }) | (T & U & { s: string; })
712+
>t : T
713+
>v : T | U
714+
>w : T | { s: string; }
715+
}
716+

0 commit comments

Comments
 (0)