Skip to content

Commit b2a517e

Browse files
committed
Accept new baselines
1 parent fa8564f commit b2a517e

File tree

4 files changed

+257
-228
lines changed

4 files changed

+257
-228
lines changed

tests/baselines/reference/inferTypes1.errors.txt

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,15 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(75,15): error TS2304: C
1515
tests/cases/conformance/types/conditional/inferTypes1.ts(75,15): error TS4081: Exported type alias 'T62' has or is using private name 'U'.
1616
tests/cases/conformance/types/conditional/inferTypes1.ts(75,43): error TS2304: Cannot find name 'U'.
1717
tests/cases/conformance/types/conditional/inferTypes1.ts(75,43): error TS4081: Exported type alias 'T62' has or is using private name 'U'.
18-
tests/cases/conformance/types/conditional/inferTypes1.ts(81,44): error TS2344: Type 'U' does not satisfy the constraint 'string'.
18+
tests/cases/conformance/types/conditional/inferTypes1.ts(76,26): error TS1338: 'infer' declarations are only permitted in the 'extends' clause of a conditional type.
19+
tests/cases/conformance/types/conditional/inferTypes1.ts(76,52): error TS1338: 'infer' declarations are only permitted in the 'extends' clause of a conditional type.
20+
tests/cases/conformance/types/conditional/inferTypes1.ts(76,62): error TS1338: 'infer' declarations are only permitted in the 'extends' clause of a conditional type.
21+
tests/cases/conformance/types/conditional/inferTypes1.ts(82,44): error TS2344: Type 'U' does not satisfy the constraint 'string'.
1922
Type 'number' is not assignable to type 'string'.
20-
tests/cases/conformance/types/conditional/inferTypes1.ts(143,40): error TS2322: Type 'T' is not assignable to type 'string'.
23+
tests/cases/conformance/types/conditional/inferTypes1.ts(144,40): error TS2322: Type 'T' is not assignable to type 'string'.
2124

2225

23-
==== tests/cases/conformance/types/conditional/inferTypes1.ts (16 errors) ====
26+
==== tests/cases/conformance/types/conditional/inferTypes1.ts (19 errors) ====
2427
type Unpacked<T> =
2528
T extends (infer U)[] ? U :
2629
T extends (...args: any[]) => infer U ? U :
@@ -127,6 +130,13 @@ tests/cases/conformance/types/conditional/inferTypes1.ts(143,40): error TS2322:
127130
!!! error TS2304: Cannot find name 'U'.
128131
~
129132
!!! error TS4081: Exported type alias 'T62' has or is using private name 'U'.
133+
type T63<T> = T extends (infer A extends infer B ? infer C : infer D) ? string : number;
134+
~~~~~~~
135+
!!! error TS1338: 'infer' declarations are only permitted in the 'extends' clause of a conditional type.
136+
~~~~~~~
137+
!!! error TS1338: 'infer' declarations are only permitted in the 'extends' clause of a conditional type.
138+
~~~~~~~
139+
!!! error TS1338: 'infer' declarations are only permitted in the 'extends' clause of a conditional type.
130140

131141
type T70<T extends string> = { x: T };
132142
type T71<T> = T extends T70<infer U> ? T70<U> : never;

tests/baselines/reference/inferTypes1.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ type T54 = X3<{ a: (x: number) => void, b: () => void }>; // number
7474
type T60 = infer U; // Error
7575
type T61<T> = infer A extends infer B ? infer C : infer D; // Error
7676
type T62<T> = U extends (infer U)[] ? U : U; // Error
77+
type T63<T> = T extends (infer A extends infer B ? infer C : infer D) ? string : number;
7778

7879
type T70<T extends string> = { x: T };
7980
type T71<T> = T extends T70<infer U> ? T70<U> : never;

0 commit comments

Comments
 (0)