@@ -452,3 +452,117 @@ let shortCutted: { a: number, b: string } = { ...o, a }
452
452
let spreadNonPrimitive = { ...<object>{}};
453
453
>spreadNonPrimitive : Symbol(spreadNonPrimitive, Decl(objectSpread.ts, 119, 3))
454
454
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
+
0 commit comments