Skip to content

Commit 41ef7a7

Browse files
committed
Accept new baselines
1 parent 577662d commit 41ef7a7

File tree

5 files changed

+194
-145
lines changed

5 files changed

+194
-145
lines changed

tests/baselines/reference/conditionalTypes2.types

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ interface B1<T> extends A1<T> {
403403
>T : T
404404

405405
boom: T extends any ? true : true
406-
>boom : true
406+
>boom : T extends any ? true : true
407407
>T : T
408408
>true : true
409409
>true : true

tests/baselines/reference/unknownType1.errors.txt

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
tests/cases/conformance/types/unknown/unknownType1.ts(45,5): error TS2571: Object is of type 'unknown'.
2-
tests/cases/conformance/types/unknown/unknownType1.ts(46,5): error TS2571: Object is of type 'unknown'.
3-
tests/cases/conformance/types/unknown/unknownType1.ts(47,5): error TS2571: Object is of type 'unknown'.
4-
tests/cases/conformance/types/unknown/unknownType1.ts(48,5): error TS2571: Object is of type 'unknown'.
5-
tests/cases/conformance/types/unknown/unknownType1.ts(49,5): error TS2571: Object is of type 'unknown'.
61
tests/cases/conformance/types/unknown/unknownType1.ts(50,5): error TS2571: Object is of type 'unknown'.
7-
tests/cases/conformance/types/unknown/unknownType1.ts(51,6): error TS2571: Object is of type 'unknown'.
8-
tests/cases/conformance/types/unknown/unknownType1.ts(52,6): error TS2571: Object is of type 'unknown'.
9-
tests/cases/conformance/types/unknown/unknownType1.ts(58,5): error TS2571: Object is of type 'unknown'.
10-
tests/cases/conformance/types/unknown/unknownType1.ts(59,5): error TS2571: Object is of type 'unknown'.
11-
tests/cases/conformance/types/unknown/unknownType1.ts(60,5): error TS2571: Object is of type 'unknown'.
12-
tests/cases/conformance/types/unknown/unknownType1.ts(61,9): error TS2571: Object is of type 'unknown'.
13-
tests/cases/conformance/types/unknown/unknownType1.ts(105,9): error TS2322: Type 'unknown' is not assignable to type 'object'.
14-
tests/cases/conformance/types/unknown/unknownType1.ts(106,9): error TS2322: Type 'unknown' is not assignable to type 'string'.
15-
tests/cases/conformance/types/unknown/unknownType1.ts(107,9): error TS2322: Type 'unknown' is not assignable to type 'string[]'.
16-
tests/cases/conformance/types/unknown/unknownType1.ts(108,9): error TS2322: Type 'unknown' is not assignable to type '{}'.
17-
tests/cases/conformance/types/unknown/unknownType1.ts(109,9): error TS2322: Type 'unknown' is not assignable to type '{} | null | undefined'.
2+
tests/cases/conformance/types/unknown/unknownType1.ts(51,5): error TS2571: Object is of type 'unknown'.
3+
tests/cases/conformance/types/unknown/unknownType1.ts(52,5): error TS2571: Object is of type 'unknown'.
4+
tests/cases/conformance/types/unknown/unknownType1.ts(53,5): error TS2571: Object is of type 'unknown'.
5+
tests/cases/conformance/types/unknown/unknownType1.ts(54,5): error TS2571: Object is of type 'unknown'.
6+
tests/cases/conformance/types/unknown/unknownType1.ts(55,5): error TS2571: Object is of type 'unknown'.
7+
tests/cases/conformance/types/unknown/unknownType1.ts(56,6): error TS2571: Object is of type 'unknown'.
8+
tests/cases/conformance/types/unknown/unknownType1.ts(57,6): error TS2571: Object is of type 'unknown'.
9+
tests/cases/conformance/types/unknown/unknownType1.ts(63,5): error TS2571: Object is of type 'unknown'.
10+
tests/cases/conformance/types/unknown/unknownType1.ts(64,5): error TS2571: Object is of type 'unknown'.
11+
tests/cases/conformance/types/unknown/unknownType1.ts(65,5): error TS2571: Object is of type 'unknown'.
12+
tests/cases/conformance/types/unknown/unknownType1.ts(66,9): error TS2571: Object is of type 'unknown'.
13+
tests/cases/conformance/types/unknown/unknownType1.ts(110,9): error TS2322: Type 'unknown' is not assignable to type 'object'.
14+
tests/cases/conformance/types/unknown/unknownType1.ts(111,9): error TS2322: Type 'unknown' is not assignable to type 'string'.
15+
tests/cases/conformance/types/unknown/unknownType1.ts(112,9): error TS2322: Type 'unknown' is not assignable to type 'string[]'.
16+
tests/cases/conformance/types/unknown/unknownType1.ts(113,9): error TS2322: Type 'unknown' is not assignable to type '{}'.
17+
tests/cases/conformance/types/unknown/unknownType1.ts(114,9): error TS2322: Type 'unknown' is not assignable to type '{} | null | undefined'.
1818
Type 'unknown' is not assignable to type '{}'.
19-
tests/cases/conformance/types/unknown/unknownType1.ts(115,9): error TS2322: Type 'T' is not assignable to type 'object'.
20-
tests/cases/conformance/types/unknown/unknownType1.ts(124,5): error TS2322: Type '123' is not assignable to type '{ [x: string]: unknown; }'.
21-
tests/cases/conformance/types/unknown/unknownType1.ts(150,14): error TS2700: Rest types may only be created from object types.
22-
tests/cases/conformance/types/unknown/unknownType1.ts(156,5): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor.
19+
tests/cases/conformance/types/unknown/unknownType1.ts(120,9): error TS2322: Type 'T' is not assignable to type 'object'.
20+
tests/cases/conformance/types/unknown/unknownType1.ts(129,5): error TS2322: Type '123' is not assignable to type '{ [x: string]: unknown; }'.
21+
tests/cases/conformance/types/unknown/unknownType1.ts(155,14): error TS2700: Rest types may only be created from object types.
22+
tests/cases/conformance/types/unknown/unknownType1.ts(161,5): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor.
2323

2424

2525
==== tests/cases/conformance/types/unknown/unknownType1.ts (21 errors) ====
@@ -53,10 +53,15 @@ tests/cases/conformance/types/unknown/unknownType1.ts(156,5): error TS2564: Prop
5353
// unknown in conditional types
5454

5555
type T30<T> = unknown extends T ? true : false; // Deferred
56-
type T31<T> = T extends unknown ? true : false; // true
56+
type T31<T> = T extends unknown ? true : false; // Deferred (so it distributes)
5757
type T32<T> = never extends T ? true : false; // true
5858
type T33<T> = T extends never ? true : false; // Deferred
5959

60+
type T35<T> = T extends unknown ? { x: T } : false;
61+
type T36 = T35<string | number>; // { x: string } | { x: number }
62+
type T37 = T35<any>; // { x: any }
63+
type T38 = T35<unknown>; // { x: unknown }
64+
6065
// keyof unknown
6166

6267
type T40 = keyof any; // string | number | symbol

tests/baselines/reference/unknownType1.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,15 @@ type T23<T> = T | unknown; // unknown
2929
// unknown in conditional types
3030

3131
type T30<T> = unknown extends T ? true : false; // Deferred
32-
type T31<T> = T extends unknown ? true : false; // true
32+
type T31<T> = T extends unknown ? true : false; // Deferred (so it distributes)
3333
type T32<T> = never extends T ? true : false; // true
3434
type T33<T> = T extends never ? true : false; // Deferred
3535

36+
type T35<T> = T extends unknown ? { x: T } : false;
37+
type T36 = T35<string | number>; // { x: string } | { x: number }
38+
type T37 = T35<any>; // { x: any }
39+
type T38 = T35<unknown>; // { x: unknown }
40+
3641
// keyof unknown
3742

3843
type T40 = keyof any; // string | number | symbol

0 commit comments

Comments
 (0)