@@ -579,3 +579,109 @@ type T3 = MaybeTrue<{ b: boolean }>; // "yes"
579
579
>MaybeTrue : Symbol(MaybeTrue, Decl(conditionalTypes2.ts, 145, 63))
580
580
>b : Symbol(b, Decl(conditionalTypes2.ts, 154, 21))
581
581
582
+ // Repro from #28824
583
+
584
+ type Union = 'a' | 'b';
585
+ >Union : Symbol(Union, Decl(conditionalTypes2.ts, 154, 36))
586
+
587
+ type Product<A extends Union, B> = { f1: A, f2: B};
588
+ >Product : Symbol(Product, Decl(conditionalTypes2.ts, 158, 23))
589
+ >A : Symbol(A, Decl(conditionalTypes2.ts, 159, 13))
590
+ >Union : Symbol(Union, Decl(conditionalTypes2.ts, 154, 36))
591
+ >B : Symbol(B, Decl(conditionalTypes2.ts, 159, 29))
592
+ >f1 : Symbol(f1, Decl(conditionalTypes2.ts, 159, 36))
593
+ >A : Symbol(A, Decl(conditionalTypes2.ts, 159, 13))
594
+ >f2 : Symbol(f2, Decl(conditionalTypes2.ts, 159, 43))
595
+ >B : Symbol(B, Decl(conditionalTypes2.ts, 159, 29))
596
+
597
+ type ProductUnion = Product<'a', 0> | Product<'b', 1>;
598
+ >ProductUnion : Symbol(ProductUnion, Decl(conditionalTypes2.ts, 159, 51))
599
+ >Product : Symbol(Product, Decl(conditionalTypes2.ts, 158, 23))
600
+ >Product : Symbol(Product, Decl(conditionalTypes2.ts, 158, 23))
601
+
602
+ // {a: "b"; b: "a"}
603
+ type UnionComplement = {
604
+ >UnionComplement : Symbol(UnionComplement, Decl(conditionalTypes2.ts, 160, 54))
605
+
606
+ [K in Union]: Exclude<Union, K>
607
+ >K : Symbol(K, Decl(conditionalTypes2.ts, 164, 3))
608
+ >Union : Symbol(Union, Decl(conditionalTypes2.ts, 154, 36))
609
+ >Exclude : Symbol(Exclude, Decl(lib.es5.d.ts, --, --))
610
+ >Union : Symbol(Union, Decl(conditionalTypes2.ts, 154, 36))
611
+ >K : Symbol(K, Decl(conditionalTypes2.ts, 164, 3))
612
+
613
+ };
614
+ type UCA = UnionComplement['a'];
615
+ >UCA : Symbol(UCA, Decl(conditionalTypes2.ts, 165, 2))
616
+ >UnionComplement : Symbol(UnionComplement, Decl(conditionalTypes2.ts, 160, 54))
617
+
618
+ type UCB = UnionComplement['b'];
619
+ >UCB : Symbol(UCB, Decl(conditionalTypes2.ts, 166, 32))
620
+ >UnionComplement : Symbol(UnionComplement, Decl(conditionalTypes2.ts, 160, 54))
621
+
622
+ // {a: "a"; b: "b"}
623
+ type UnionComplementComplement = {
624
+ >UnionComplementComplement : Symbol(UnionComplementComplement, Decl(conditionalTypes2.ts, 167, 32))
625
+
626
+ [K in Union]: Exclude<Union, Exclude<Union, K>>
627
+ >K : Symbol(K, Decl(conditionalTypes2.ts, 171, 3))
628
+ >Union : Symbol(Union, Decl(conditionalTypes2.ts, 154, 36))
629
+ >Exclude : Symbol(Exclude, Decl(lib.es5.d.ts, --, --))
630
+ >Union : Symbol(Union, Decl(conditionalTypes2.ts, 154, 36))
631
+ >Exclude : Symbol(Exclude, Decl(lib.es5.d.ts, --, --))
632
+ >Union : Symbol(Union, Decl(conditionalTypes2.ts, 154, 36))
633
+ >K : Symbol(K, Decl(conditionalTypes2.ts, 171, 3))
634
+
635
+ };
636
+ type UCCA = UnionComplementComplement['a'];
637
+ >UCCA : Symbol(UCCA, Decl(conditionalTypes2.ts, 172, 2))
638
+ >UnionComplementComplement : Symbol(UnionComplementComplement, Decl(conditionalTypes2.ts, 167, 32))
639
+
640
+ type UCCB = UnionComplementComplement['b'];
641
+ >UCCB : Symbol(UCCB, Decl(conditionalTypes2.ts, 173, 43))
642
+ >UnionComplementComplement : Symbol(UnionComplementComplement, Decl(conditionalTypes2.ts, 167, 32))
643
+
644
+ // {a: Product<'b', 1>; b: Product<'a', 0>}
645
+ type ProductComplement = {
646
+ >ProductComplement : Symbol(ProductComplement, Decl(conditionalTypes2.ts, 174, 43))
647
+
648
+ [K in Union]: Exclude<ProductUnion, { f1: K }>
649
+ >K : Symbol(K, Decl(conditionalTypes2.ts, 178, 3))
650
+ >Union : Symbol(Union, Decl(conditionalTypes2.ts, 154, 36))
651
+ >Exclude : Symbol(Exclude, Decl(lib.es5.d.ts, --, --))
652
+ >ProductUnion : Symbol(ProductUnion, Decl(conditionalTypes2.ts, 159, 51))
653
+ >f1 : Symbol(f1, Decl(conditionalTypes2.ts, 178, 39))
654
+ >K : Symbol(K, Decl(conditionalTypes2.ts, 178, 3))
655
+
656
+ };
657
+ type PCA = ProductComplement['a'];
658
+ >PCA : Symbol(PCA, Decl(conditionalTypes2.ts, 179, 2))
659
+ >ProductComplement : Symbol(ProductComplement, Decl(conditionalTypes2.ts, 174, 43))
660
+
661
+ type PCB = ProductComplement['b'];
662
+ >PCB : Symbol(PCB, Decl(conditionalTypes2.ts, 180, 34))
663
+ >ProductComplement : Symbol(ProductComplement, Decl(conditionalTypes2.ts, 174, 43))
664
+
665
+ // {a: Product<'a', 0>; b: Product<'b', 1>}
666
+ type ProductComplementComplement = {
667
+ >ProductComplementComplement : Symbol(ProductComplementComplement, Decl(conditionalTypes2.ts, 181, 34))
668
+
669
+ [K in Union]: Exclude<ProductUnion, Exclude<ProductUnion, { f1: K }>>
670
+ >K : Symbol(K, Decl(conditionalTypes2.ts, 185, 3))
671
+ >Union : Symbol(Union, Decl(conditionalTypes2.ts, 154, 36))
672
+ >Exclude : Symbol(Exclude, Decl(lib.es5.d.ts, --, --))
673
+ >ProductUnion : Symbol(ProductUnion, Decl(conditionalTypes2.ts, 159, 51))
674
+ >Exclude : Symbol(Exclude, Decl(lib.es5.d.ts, --, --))
675
+ >ProductUnion : Symbol(ProductUnion, Decl(conditionalTypes2.ts, 159, 51))
676
+ >f1 : Symbol(f1, Decl(conditionalTypes2.ts, 185, 61))
677
+ >K : Symbol(K, Decl(conditionalTypes2.ts, 185, 3))
678
+
679
+ };
680
+ type PCCA = ProductComplementComplement['a'];
681
+ >PCCA : Symbol(PCCA, Decl(conditionalTypes2.ts, 186, 2))
682
+ >ProductComplementComplement : Symbol(ProductComplementComplement, Decl(conditionalTypes2.ts, 181, 34))
683
+
684
+ type PCCB = ProductComplementComplement['b'];
685
+ >PCCB : Symbol(PCCB, Decl(conditionalTypes2.ts, 187, 45))
686
+ >ProductComplementComplement : Symbol(ProductComplementComplement, Decl(conditionalTypes2.ts, 181, 34))
687
+
0 commit comments