11=== tests/cases/conformance/types/conditional/conditionalTypes1.ts ===
22type T00 = Exclude<"a" | "b" | "c" | "d", "a" | "c" | "f">; // "b" | "d"
3- >T00 : "b" | "d"
3+ >T00 : T00
44
55type T01 = Extract<"a" | "b" | "c" | "d", "a" | "c" | "f">; // "a" | "c"
6- >T01 : "a" | "c"
6+ >T01 : T01
77
88type T02 = Exclude<string | number | (() => void), Function>; // string | number
9- >T02 : string | number
9+ >T02 : T02
1010
1111type T03 = Extract<string | number | (() => void), Function>; // () => void
1212>T03 : () => void
1313
1414type T04 = NonNullable<string | number | undefined>; // string | number
15- >T04 : string | number
15+ >T04 : T04
1616
1717type T05 = NonNullable<(() => string) | string[] | null | undefined>; // (() => string) | string[]
18- >T05 : (() => string) | string[]
18+ >T05 : T05
1919>null : null
2020
2121function f1<T>(x: T, y: NonNullable<T>) {
@@ -113,7 +113,7 @@ type T10 = Exclude<Options, { k: "a" | "b" }>; // { k: "c", c: boolean }
113113>k : "a" | "b"
114114
115115type T11 = Extract<Options, { k: "a" | "b" }>; // { k: "a", a: number } | { k: "b", b: string }
116- >T11 : { k: "a"; a: number; } | { k: "b"; b: string; }
116+ >T11 : T11
117117>k : "a" | "b"
118118
119119type T12 = Exclude<Options, { k: "a" } | { k: "b" }>; // { k: "c", c: boolean }
@@ -122,12 +122,12 @@ type T12 = Exclude<Options, { k: "a" } | { k: "b" }>; // { k: "c", c: boolean }
122122>k : "b"
123123
124124type T13 = Extract<Options, { k: "a" } | { k: "b" }>; // { k: "a", a: number } | { k: "b", b: string }
125- >T13 : { k: "a"; a: number; } | { k: "b"; b: string; }
125+ >T13 : T13
126126>k : "a"
127127>k : "b"
128128
129129type T14 = Exclude<Options, { q: "a" }>; // Options
130- >T14 : Options
130+ >T14 : T14
131131>q : "a"
132132
133133type T15 = Extract<Options, { q: "a" }>; // never
@@ -146,17 +146,17 @@ let x0 = f5("a"); // { k: "a", a: number }
146146>"a" : "a"
147147
148148type OptionsOfKind<K extends Options["k"]> = Extract<Options, { k: K }>;
149- >OptionsOfKind : Extract<{ k: "a"; a: number; }, { k: K; }> | Extract<{ k: "b"; b: string; }, { k: K; }> | Extract<{ k: "c"; c: boolean; }, { k: K; } >
149+ >OptionsOfKind : OptionsOfKind<K >
150150>k : K
151151
152152type T16 = OptionsOfKind<"a" | "b">; // { k: "a", a: number } | { k: "b", b: string }
153- >T16 : { k: "a"; a: number; } | { k: "b"; b: string; }
153+ >T16 : T16
154154
155155type Select<T, K extends keyof T, V extends T[K]> = Extract<T, { [P in K]: V }>;
156- >Select : Extract <T, { [P in K]: V; } >
156+ >Select : Select <T, K, V >
157157
158158type T17 = Select<Options, "k", "a" | "b">; // // { k: "a", a: number } | { k: "b", b: string }
159- >T17 : { k: "a"; a: number; } | { k: "b"; b: string; }
159+ >T17 : T17
160160
161161type TypeName<T> =
162162>TypeName : TypeName<T>
@@ -169,7 +169,7 @@ type TypeName<T> =
169169 "object";
170170
171171type T20 = TypeName<string | (() => void)>; // "string" | "function"
172- >T20 : "string" | "function"
172+ >T20 : T20
173173
174174type T21 = TypeName<any>; // "string" | "number" | "boolean" | "undefined" | "function" | "object"
175175>T21 : "string" | "number" | "boolean" | "undefined" | "object" | "function"
@@ -230,19 +230,19 @@ type FunctionPropertyNames<T> = { [K in keyof T]: T[K] extends Function ? K : ne
230230>FunctionPropertyNames : FunctionPropertyNames<T>
231231
232232type FunctionProperties<T> = Pick<T, FunctionPropertyNames<T>>;
233- >FunctionProperties : Pick<T, FunctionPropertyNames<T> >
233+ >FunctionProperties : FunctionProperties<T >
234234
235235type NonFunctionPropertyNames<T> = { [K in keyof T]: T[K] extends Function ? never : K }[keyof T];
236236>NonFunctionPropertyNames : NonFunctionPropertyNames<T>
237237
238238type NonFunctionProperties<T> = Pick<T, NonFunctionPropertyNames<T>>;
239- >NonFunctionProperties : Pick<T, NonFunctionPropertyNames<T> >
239+ >NonFunctionProperties : NonFunctionProperties<T >
240240
241241type T30 = FunctionProperties<Part>;
242- >T30 : Pick<Part, "updatePart">
242+ >T30 : T30
243243
244244type T31 = NonFunctionProperties<Part>;
245- >T31 : Pick<Part, NonFunctionPropertyNames<Part>>
245+ >T31 : T31
246246
247247function f7<T>(x: T, y: FunctionProperties<T>, z: NonFunctionProperties<T>) {
248248>f7 : <T>(x: T, y: FunctionProperties<T>, z: NonFunctionProperties<T>) => void
@@ -523,20 +523,20 @@ type If<C extends boolean, T, F> = C extends true ? T : F;
523523>true : true
524524
525525type Not<C extends boolean> = If<C, false, true>;
526- >Not : If<C, false, true >
526+ >Not : Not<C >
527527>false : false
528528>true : true
529529
530530type And<A extends boolean, B extends boolean> = If<A, B, false>;
531- >And : If <A, B, false >
531+ >And : And <A, B>
532532>false : false
533533
534534type Or<A extends boolean, B extends boolean> = If<A, true, B>;
535- >Or : If<A, true , B>
535+ >Or : Or<A , B>
536536>true : true
537537
538538type IsString<T> = Extends<T, string>;
539- >IsString : Extends<T, string >
539+ >IsString : IsString<T >
540540
541541type Q1 = IsString<number>; // false
542542>Q1 : false
@@ -559,7 +559,7 @@ type N2 = Not<true>; // false
559559>true : true
560560
561561type N3 = Not<boolean>; // boolean
562- >N3 : boolean
562+ >N3 : N3
563563
564564type A1 = And<false, false>; // false
565565>A1 : false
@@ -590,15 +590,15 @@ type A6 = And<false, boolean>; // false
590590>false : false
591591
592592type A7 = And<boolean, true>; // boolean
593- >A7 : boolean
593+ >A7 : A7
594594>true : true
595595
596596type A8 = And<true, boolean>; // boolean
597597>A8 : boolean
598598>true : true
599599
600600type A9 = And<boolean, boolean>; // boolean
601- >A9 : boolean
601+ >A9 : A9
602602
603603type O1 = Or<false, false>; // false
604604>O1 : false
@@ -621,7 +621,7 @@ type O4 = Or<true, true>; // true
621621>true : true
622622
623623type O5 = Or<boolean, false>; // boolean
624- >O5 : boolean
624+ >O5 : O5
625625>false : false
626626
627627type O6 = Or<false, boolean>; // boolean
@@ -637,7 +637,7 @@ type O8 = Or<true, boolean>; // true
637637>true : true
638638
639639type O9 = Or<boolean, boolean>; // boolean
640- >O9 : boolean
640+ >O9 : O9
641641
642642type T40 = never extends never ? true : false; // true
643643>T40 : true
@@ -785,7 +785,7 @@ const convert = <U>(value: Foo<U>): Bar<U> => value;
785785>value : Foo<U>
786786
787787type Baz<T> = Foo<T>;
788- >Baz : Foo <T>
788+ >Baz : Baz <T>
789789
790790const convert2 = <T>(value: Foo<T>): Baz<T> => value;
791791>convert2 : <T>(value: Foo<T>) => Foo<T>
@@ -816,7 +816,7 @@ function f32<T, U>() {
816816>T1 : T & U extends string ? boolean : number
817817
818818 type T2 = Foo<T & U>;
819- >T2 : Foo< T & U>
819+ >T2 : T & U extends string ? boolean : number
820820
821821 var z: T1;
822822>z : T & U extends string ? boolean : number
@@ -829,16 +829,16 @@ function f33<T, U>() {
829829>f33 : <T, U>() => void
830830
831831 type T1 = Foo<T & U>;
832- >T1 : Foo< T & U>
832+ >T1 : T & U extends string ? boolean : number
833833
834834 type T2 = Bar<T & U>;
835- >T2 : Bar< T & U>
835+ >T2 : T & U extends string ? boolean : number
836836
837837 var z: T1;
838- >z : Foo< T & U>
838+ >z : T & U extends string ? boolean : number
839839
840840 var z: T2;
841- >z : Foo< T & U>
841+ >z : T & U extends string ? boolean : number
842842}
843843
844844// Repro from #21823
@@ -971,19 +971,19 @@ type c2 = B2['c']; // 'c' | 'b'
971971// Repro from #21929
972972
973973type NonFooKeys1<T extends object> = OldDiff<keyof T, 'foo'>;
974- >NonFooKeys1 : OldDiff<keyof T, "foo" >
974+ >NonFooKeys1 : NonFooKeys1<T >
975975
976976type NonFooKeys2<T extends object> = Exclude<keyof T, 'foo'>;
977- >NonFooKeys2 : Exclude<keyof T, "foo" >
977+ >NonFooKeys2 : NonFooKeys2<T >
978978
979979type Test1 = NonFooKeys1<{foo: 1, bar: 2, baz: 3}>; // "bar" | "baz"
980- >Test1 : OldDiff<"foo" | "bar" | "baz", "foo">
980+ >Test1 : Test1
981981>foo : 1
982982>bar : 2
983983>baz : 3
984984
985985type Test2 = NonFooKeys2<{foo: 1, bar: 2, baz: 3}>; // "bar" | "baz"
986- >Test2 : "bar" | "baz"
986+ >Test2 : Test2
987987>foo : 1
988988>bar : 2
989989>baz : 3
0 commit comments