Skip to content

Commit 6c60f7e

Browse files
committed
Accept new baselines
1 parent c344e6d commit 6c60f7e

6 files changed

+92
-171
lines changed

tests/baselines/reference/conditionalTypes1.errors.txt

+40-122
Large diffs are not rendered by default.

tests/baselines/reference/keyofAndIndexedAccess.types

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ type K11 = keyof Shape[]; // "length" | "toString" | ...
9292
>Shape : Shape
9393

9494
type K12 = keyof Dictionary<Shape>; // string
95-
>K12 : string | number
95+
>K12 : string | number | symbol
9696
>Dictionary : Dictionary<T>
9797
>Shape : Shape
9898

@@ -136,7 +136,7 @@ type K20 = KeyOf<Shape>; // "name" | "width" | "height" | "visible"
136136
>Shape : Shape
137137

138138
type K21 = KeyOf<Dictionary<Shape>>; // string
139-
>K21 : string | number
139+
>K21 : string | number | symbol
140140
>KeyOf : keyof T
141141
>Dictionary : Dictionary<T>
142142
>Shape : Shape
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
tests/cases/compiler/limitDeepInstantiations.ts(3,35): error TS2502: '"true"' is referenced directly or indirectly in its own type annotation.
2-
tests/cases/compiler/limitDeepInstantiations.ts(5,13): error TS2344: Type '"false"' does not satisfy the constraint '"true"'.
32

43

5-
==== tests/cases/compiler/limitDeepInstantiations.ts (2 errors) ====
4+
==== tests/cases/compiler/limitDeepInstantiations.ts (1 errors) ====
65
// Repro from #14837
76

87
type Foo<T extends "true", B> = { "true": Foo<T, Foo<T, B>> }[T];
98
~~~~~~~~~~~~~~~~~~~~~~~~~
109
!!! error TS2502: '"true"' is referenced directly or indirectly in its own type annotation.
1110
let f1: Foo<"true", {}>;
1211
let f2: Foo<"false", {}>;
13-
~~~~~~~
14-
!!! error TS2344: Type '"false"' does not satisfy the constraint '"true"'.
1512

tests/baselines/reference/mappedTypeErrors2.errors.txt

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(9,30): error TS2536: Type 'K' cannot be used to index type 'T1<K>'.
22
tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(13,30): error TS2536: Type 'K' cannot be used to index type 'T3'.
3+
tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(15,38): error TS2536: Type 'S' cannot be used to index type '{ [key in AB[S]]: true; }'.
4+
tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(15,47): error TS2322: Type 'AB[S]' is not assignable to type 'string | number | symbol'.
5+
Type 'AB[S]' is not assignable to type 'symbol'.
36
tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(15,47): error TS2536: Type 'S' cannot be used to index type 'AB'.
47
tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(17,49): error TS2536: Type 'L' cannot be used to index type '{ [key in AB[S]]: true; }'.
58

69

7-
==== tests/cases/conformance/types/mapped/mappedTypeErrors2.ts (4 errors) ====
10+
==== tests/cases/conformance/types/mapped/mappedTypeErrors2.ts (6 errors) ====
811
// Repros from #17238
912

1013
type AB = {
@@ -24,6 +27,11 @@ tests/cases/conformance/types/mapped/mappedTypeErrors2.ts(17,49): error TS2536:
2427
!!! error TS2536: Type 'K' cannot be used to index type 'T3'.
2528

2629
type T5<S extends 'a'|'b'|'extra'> = {[key in AB[S]]: true}[S]; // Error
30+
~~~~~~~~~~~~~~~~~~~~~~~~~
31+
!!! error TS2536: Type 'S' cannot be used to index type '{ [key in AB[S]]: true; }'.
32+
~~~~~
33+
!!! error TS2322: Type 'AB[S]' is not assignable to type 'string | number | symbol'.
34+
!!! error TS2322: Type 'AB[S]' is not assignable to type 'symbol'.
2735
~~~~~
2836
!!! error TS2536: Type 'S' cannot be used to index type 'AB'.
2937

tests/baselines/reference/mappedTypeRelationships.errors.txt

+39-41
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,27 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(25,5): error TS2
1010
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(26,5): error TS2322: Type 'T[K]' is not assignable to type 'U[K]'.
1111
Type 'T' is not assignable to type 'U'.
1212
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(26,12): error TS2536: Type 'K' cannot be used to index type 'T'.
13-
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(30,5): error TS2322: Type 'Partial<T>[keyof T]' is not assignable to type 'T[keyof T]'.
14-
Type 'T[keyof T] | undefined' is not assignable to type 'T[keyof T]'.
15-
Type 'undefined' is not assignable to type 'T[keyof T]'.
16-
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(35,5): error TS2322: Type 'Partial<T>[K]' is not assignable to type 'T[K]'.
17-
Type 'T[K] | undefined' is not assignable to type 'T[K]'.
18-
Type 'undefined' is not assignable to type 'T[K]'.
19-
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(40,5): error TS2322: Type 'Partial<U>[keyof T]' is not assignable to type 'T[keyof T]'.
20-
Type 'U[keyof T] | undefined' is not assignable to type 'T[keyof T]'.
21-
Type 'undefined' is not assignable to type 'T[keyof T]'.
22-
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(45,5): error TS2322: Type 'Partial<U>[K]' is not assignable to type 'T[K]'.
23-
Type 'U[K] | undefined' is not assignable to type 'T[K]'.
24-
Type 'undefined' is not assignable to type 'T[K]'.
13+
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(30,5): error TS2322: Type 'T[keyof T] | undefined' is not assignable to type 'T[keyof T]'.
14+
Type 'undefined' is not assignable to type 'T[keyof T]'.
15+
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(35,5): error TS2322: Type 'T[K] | undefined' is not assignable to type 'T[K]'.
16+
Type 'undefined' is not assignable to type 'T[K]'.
17+
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(40,5): error TS2322: Type 'U[keyof T] | undefined' is not assignable to type 'T[keyof T]'.
18+
Type 'undefined' is not assignable to type 'T[keyof T]'.
19+
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(41,5): error TS2322: Type 'T[keyof T]' is not assignable to type 'U[keyof T] | undefined'.
20+
Type 'T[keyof T]' is not assignable to type 'U[keyof T]'.
21+
Type 'T' is not assignable to type 'U'.
22+
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(45,5): error TS2322: Type 'U[K] | undefined' is not assignable to type 'T[K]'.
23+
Type 'undefined' is not assignable to type 'T[K]'.
24+
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(46,5): error TS2322: Type 'T[K]' is not assignable to type 'U[K] | undefined'.
25+
Type 'T[K]' is not assignable to type 'U[K]'.
26+
Type 'T' is not assignable to type 'U'.
2527
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(51,5): error TS2542: Index signature in type 'Readonly<T>' only permits reading.
2628
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(56,5): error TS2542: Index signature in type 'Readonly<T>' only permits reading.
27-
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(61,5): error TS2322: Type 'T[keyof T]' is not assignable to type 'Readonly<U>[keyof T]'.
28-
Type 'T' is not assignable to type 'Readonly<U>'.
29-
Type 'T[keyof T]' is not assignable to type 'U[keyof T]'.
30-
Type 'T' is not assignable to type 'U'.
29+
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(61,5): error TS2322: Type 'T[keyof T]' is not assignable to type 'U[keyof T]'.
30+
Type 'T' is not assignable to type 'U'.
3131
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(61,5): error TS2542: Index signature in type 'Readonly<U>' only permits reading.
32-
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(66,5): error TS2322: Type 'T[K]' is not assignable to type 'Readonly<U>[K]'.
33-
Type 'T' is not assignable to type 'Readonly<U>'.
34-
Type 'T[K]' is not assignable to type 'U[K]'.
35-
Type 'T' is not assignable to type 'U'.
32+
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(66,5): error TS2322: Type 'T[K]' is not assignable to type 'U[K]'.
33+
Type 'T' is not assignable to type 'U'.
3634
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(66,5): error TS2542: Index signature in type 'Readonly<U>' only permits reading.
3735
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(72,5): error TS2322: Type 'Partial<T>' is not assignable to type 'T'.
3836
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(78,5): error TS2322: Type 'Partial<Thing>' is not assignable to type 'Partial<T>'.
@@ -62,7 +60,7 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(168,5): error TS
6260
Type 'T' is not assignable to type 'U'.
6361

6462

65-
==== tests/cases/conformance/types/mapped/mappedTypeRelationships.ts (28 errors) ====
63+
==== tests/cases/conformance/types/mapped/mappedTypeRelationships.ts (30 errors) ====
6664
function f1<T>(x: T, k: keyof T) {
6765
return x[k];
6866
}
@@ -114,37 +112,41 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(168,5): error TS
114112
function f10<T>(x: T, y: Partial<T>, k: keyof T) {
115113
x[k] = y[k]; // Error
116114
~~~~
117-
!!! error TS2322: Type 'Partial<T>[keyof T]' is not assignable to type 'T[keyof T]'.
118-
!!! error TS2322: Type 'T[keyof T] | undefined' is not assignable to type 'T[keyof T]'.
119-
!!! error TS2322: Type 'undefined' is not assignable to type 'T[keyof T]'.
115+
!!! error TS2322: Type 'T[keyof T] | undefined' is not assignable to type 'T[keyof T]'.
116+
!!! error TS2322: Type 'undefined' is not assignable to type 'T[keyof T]'.
120117
y[k] = x[k];
121118
}
122119

123120
function f11<T, K extends keyof T>(x: T, y: Partial<T>, k: K) {
124121
x[k] = y[k]; // Error
125122
~~~~
126-
!!! error TS2322: Type 'Partial<T>[K]' is not assignable to type 'T[K]'.
127-
!!! error TS2322: Type 'T[K] | undefined' is not assignable to type 'T[K]'.
128-
!!! error TS2322: Type 'undefined' is not assignable to type 'T[K]'.
123+
!!! error TS2322: Type 'T[K] | undefined' is not assignable to type 'T[K]'.
124+
!!! error TS2322: Type 'undefined' is not assignable to type 'T[K]'.
129125
y[k] = x[k];
130126
}
131127

132128
function f12<T, U extends T>(x: T, y: Partial<U>, k: keyof T) {
133129
x[k] = y[k]; // Error
134130
~~~~
135-
!!! error TS2322: Type 'Partial<U>[keyof T]' is not assignable to type 'T[keyof T]'.
136-
!!! error TS2322: Type 'U[keyof T] | undefined' is not assignable to type 'T[keyof T]'.
137-
!!! error TS2322: Type 'undefined' is not assignable to type 'T[keyof T]'.
131+
!!! error TS2322: Type 'U[keyof T] | undefined' is not assignable to type 'T[keyof T]'.
132+
!!! error TS2322: Type 'undefined' is not assignable to type 'T[keyof T]'.
138133
y[k] = x[k]; // Error
134+
~~~~
135+
!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'U[keyof T] | undefined'.
136+
!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'U[keyof T]'.
137+
!!! error TS2322: Type 'T' is not assignable to type 'U'.
139138
}
140139

141140
function f13<T, U extends T, K extends keyof T>(x: T, y: Partial<U>, k: K) {
142141
x[k] = y[k]; // Error
143142
~~~~
144-
!!! error TS2322: Type 'Partial<U>[K]' is not assignable to type 'T[K]'.
145-
!!! error TS2322: Type 'U[K] | undefined' is not assignable to type 'T[K]'.
146-
!!! error TS2322: Type 'undefined' is not assignable to type 'T[K]'.
143+
!!! error TS2322: Type 'U[K] | undefined' is not assignable to type 'T[K]'.
144+
!!! error TS2322: Type 'undefined' is not assignable to type 'T[K]'.
147145
y[k] = x[k]; // Error
146+
~~~~
147+
!!! error TS2322: Type 'T[K]' is not assignable to type 'U[K] | undefined'.
148+
!!! error TS2322: Type 'T[K]' is not assignable to type 'U[K]'.
149+
!!! error TS2322: Type 'T' is not assignable to type 'U'.
148150
}
149151

150152
function f20<T>(x: T, y: Readonly<T>, k: keyof T) {
@@ -165,10 +167,8 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(168,5): error TS
165167
x[k] = y[k];
166168
y[k] = x[k]; // Error
167169
~~~~
168-
!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'Readonly<U>[keyof T]'.
169-
!!! error TS2322: Type 'T' is not assignable to type 'Readonly<U>'.
170-
!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'U[keyof T]'.
171-
!!! error TS2322: Type 'T' is not assignable to type 'U'.
170+
!!! error TS2322: Type 'T[keyof T]' is not assignable to type 'U[keyof T]'.
171+
!!! error TS2322: Type 'T' is not assignable to type 'U'.
172172
~~~~
173173
!!! error TS2542: Index signature in type 'Readonly<U>' only permits reading.
174174
}
@@ -177,10 +177,8 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(168,5): error TS
177177
x[k] = y[k];
178178
y[k] = x[k]; // Error
179179
~~~~
180-
!!! error TS2322: Type 'T[K]' is not assignable to type 'Readonly<U>[K]'.
181-
!!! error TS2322: Type 'T' is not assignable to type 'Readonly<U>'.
182-
!!! error TS2322: Type 'T[K]' is not assignable to type 'U[K]'.
183-
!!! error TS2322: Type 'T' is not assignable to type 'U'.
180+
!!! error TS2322: Type 'T[K]' is not assignable to type 'U[K]'.
181+
!!! error TS2322: Type 'T' is not assignable to type 'U'.
184182
~~~~
185183
!!! error TS2542: Index signature in type 'Readonly<U>' only permits reading.
186184
}

tests/baselines/reference/recursiveTypeRelations.types

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export function css<S extends { [K in keyof S]: string }>(styles: S, ...classNam
9797
if (typeof arg == "object") {
9898
>typeof arg == "object" : boolean
9999
>typeof arg : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function"
100-
>arg : object & { [K in keyof S]?: boolean; }
100+
>arg : keyof S | (object & { [K in keyof S]?: boolean; })
101101
>"object" : "object"
102102

103103
return Object.keys(arg).reduce<ClassNameObject>((obj: ClassNameObject, key: keyof S) => {

0 commit comments

Comments
 (0)