|
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'. |
6 | 1 | 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'. |
18 | 18 | 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. |
23 | 23 |
|
24 | 24 |
|
25 | 25 | ==== 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
|
53 | 53 | // unknown in conditional types
|
54 | 54 |
|
55 | 55 | 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) |
57 | 57 | type T32<T> = never extends T ? true : false; // true
|
58 | 58 | type T33<T> = T extends never ? true : false; // Deferred
|
59 | 59 |
|
| 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 | + |
60 | 65 | // keyof unknown
|
61 | 66 |
|
62 | 67 | type T40 = keyof any; // string | number | symbol
|
|
0 commit comments