Skip to content

Commit a48b222

Browse files
committed
Accept new baselines
1 parent f6ed29d commit a48b222

File tree

2 files changed

+37
-26
lines changed

2 files changed

+37
-26
lines changed

tests/baselines/reference/mappedTypeRelationships.errors.txt

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -60,25 +60,26 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(51,5): error TS2
6060
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(56,5): error TS2542: Index signature in type 'Readonly<T>' only permits reading.
6161
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(61,5): error TS2542: Index signature in type 'Readonly<U>' only permits reading.
6262
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(66,5): error TS2542: Index signature in type 'Readonly<U>' only permits reading.
63-
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(70,5): error TS2322: Type 'Partial<T>' is not assignable to type 'T'.
64-
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(75,5): error TS2322: Type 'Partial<T>' is not assignable to type 'T'.
65-
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(125,5): error TS2322: Type 'Partial<U>' is not assignable to type 'Identity<U>'.
66-
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(141,5): error TS2322: Type '{ [P in keyof T]: T[P]; }' is not assignable to type '{ [P in keyof T]: U[P]; }'.
63+
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(72,5): error TS2322: Type 'Partial<T>' is not assignable to type 'T'.
64+
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(78,5): error TS2322: Type 'Partial<Thing>' is not assignable to type 'Partial<T>'.
65+
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(88,5): error TS2322: Type 'Readonly<Thing>' is not assignable to type 'Readonly<T>'.
66+
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(127,5): error TS2322: Type 'Partial<U>' is not assignable to type 'Identity<U>'.
67+
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(143,5): error TS2322: Type '{ [P in keyof T]: T[P]; }' is not assignable to type '{ [P in keyof T]: U[P]; }'.
6768
Type 'T[P]' is not assignable to type 'U[P]'.
6869
Type 'T[string]' is not assignable to type 'U[P]'.
6970
Type 'T[string]' is not assignable to type 'U[string]'.
7071
Type 'T[P]' is not assignable to type 'U[string]'.
7172
Type 'T[string]' is not assignable to type 'U[string]'.
7273
Type 'T' is not assignable to type 'U'.
73-
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(146,5): error TS2322: Type '{ [P in keyof T]: T[P]; }' is not assignable to type '{ [P in keyof U]: U[P]; }'.
74+
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(148,5): error TS2322: Type '{ [P in keyof T]: T[P]; }' is not assignable to type '{ [P in keyof U]: U[P]; }'.
7475
Type 'keyof U' is not assignable to type 'keyof T'.
75-
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(151,5): error TS2322: Type '{ [P in K]: T[P]; }' is not assignable to type '{ [P in keyof T]: T[P]; }'.
76+
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(153,5): error TS2322: Type '{ [P in K]: T[P]; }' is not assignable to type '{ [P in keyof T]: T[P]; }'.
7677
Type 'keyof T' is not assignable to type 'K'.
77-
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(156,5): error TS2322: Type '{ [P in K]: T[P]; }' is not assignable to type '{ [P in keyof U]: U[P]; }'.
78+
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(158,5): error TS2322: Type '{ [P in K]: T[P]; }' is not assignable to type '{ [P in keyof U]: U[P]; }'.
7879
Type 'keyof U' is not assignable to type 'K'.
79-
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(161,5): error TS2322: Type '{ [P in K]: T[P]; }' is not assignable to type '{ [P in keyof T]: U[P]; }'.
80+
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(163,5): error TS2322: Type '{ [P in K]: T[P]; }' is not assignable to type '{ [P in keyof T]: U[P]; }'.
8081
Type 'keyof T' is not assignable to type 'K'.
81-
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(166,5): error TS2322: Type '{ [P in K]: T[P]; }' is not assignable to type '{ [P in K]: U[P]; }'.
82+
tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(168,5): error TS2322: Type '{ [P in K]: T[P]; }' is not assignable to type '{ [P in K]: U[P]; }'.
8283
Type 'T[P]' is not assignable to type 'U[P]'.
8384
Type 'T[string]' is not assignable to type 'U[P]'.
8485
Type 'T[string]' is not assignable to type 'U[string]'.
@@ -87,7 +88,7 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(166,5): error TS
8788
Type 'T' is not assignable to type 'U'.
8889

8990

90-
==== tests/cases/conformance/types/mapped/mappedTypeRelationships.ts (27 errors) ====
91+
==== tests/cases/conformance/types/mapped/mappedTypeRelationships.ts (28 errors) ====
9192
function f1<T>(x: T, k: keyof T) {
9293
return x[k];
9394
}
@@ -236,28 +237,32 @@ tests/cases/conformance/types/mapped/mappedTypeRelationships.ts(166,5): error TS
236237
!!! error TS2542: Index signature in type 'Readonly<U>' only permits reading.
237238
}
238239

240+
type Thing = { a: string, b: string };
241+
239242
function f30<T>(x: T, y: Partial<T>) {
240243
x = y; // Error
241244
~
242245
!!! error TS2322: Type 'Partial<T>' is not assignable to type 'T'.
243246
y = x;
244247
}
245248

246-
function f31<T>(x: T, y: Partial<T>) {
247-
x = y; // Error
249+
function f31<T extends Thing>(x: Partial<Thing>, y: Partial<T>) {
250+
x = y;
251+
y = x; // Error
248252
~
249-
!!! error TS2322: Type 'Partial<T>' is not assignable to type 'T'.
250-
y = x;
253+
!!! error TS2322: Type 'Partial<Thing>' is not assignable to type 'Partial<T>'.
251254
}
252255

253256
function f40<T>(x: T, y: Readonly<T>) {
254257
x = y;
255258
y = x;
256259
}
257260

258-
function f41<T>(x: T, y: Readonly<T>) {
261+
function f41<T extends Thing>(x: Readonly<Thing>, y: Readonly<T>) {
259262
x = y;
260-
y = x;
263+
y = x; // Error
264+
~
265+
!!! error TS2322: Type 'Readonly<Thing>' is not assignable to type 'Readonly<T>'.
261266
}
262267

263268
type Item = {

tests/baselines/reference/mappedTypeRelationships.js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,24 +67,26 @@ function f23<T, U extends T, K extends keyof T>(x: T, y: Readonly<U>, k: K) {
6767
y[k] = x[k]; // Error
6868
}
6969

70+
type Thing = { a: string, b: string };
71+
7072
function f30<T>(x: T, y: Partial<T>) {
7173
x = y; // Error
7274
y = x;
7375
}
7476

75-
function f31<T>(x: T, y: Partial<T>) {
76-
x = y; // Error
77-
y = x;
77+
function f31<T extends Thing>(x: Partial<Thing>, y: Partial<T>) {
78+
x = y;
79+
y = x; // Error
7880
}
7981

8082
function f40<T>(x: T, y: Readonly<T>) {
8183
x = y;
8284
y = x;
8385
}
8486

85-
function f41<T>(x: T, y: Readonly<T>) {
87+
function f41<T extends Thing>(x: Readonly<Thing>, y: Readonly<T>) {
8688
x = y;
87-
y = x;
89+
y = x; // Error
8890
}
8991

9092
type Item = {
@@ -228,16 +230,16 @@ function f30(x, y) {
228230
y = x;
229231
}
230232
function f31(x, y) {
231-
x = y; // Error
232-
y = x;
233+
x = y;
234+
y = x; // Error
233235
}
234236
function f40(x, y) {
235237
x = y;
236238
y = x;
237239
}
238240
function f41(x, y) {
239241
x = y;
240-
y = x;
242+
y = x; // Error
241243
}
242244
function f50(obj, key) {
243245
var item = obj[key];
@@ -304,10 +306,14 @@ declare function f20<T>(x: T, y: Readonly<T>, k: keyof T): void;
304306
declare function f21<T, K extends keyof T>(x: T, y: Readonly<T>, k: K): void;
305307
declare function f22<T, U extends T>(x: T, y: Readonly<U>, k: keyof T): void;
306308
declare function f23<T, U extends T, K extends keyof T>(x: T, y: Readonly<U>, k: K): void;
309+
declare type Thing = {
310+
a: string;
311+
b: string;
312+
};
307313
declare function f30<T>(x: T, y: Partial<T>): void;
308-
declare function f31<T>(x: T, y: Partial<T>): void;
314+
declare function f31<T extends Thing>(x: Partial<Thing>, y: Partial<T>): void;
309315
declare function f40<T>(x: T, y: Readonly<T>): void;
310-
declare function f41<T>(x: T, y: Readonly<T>): void;
316+
declare function f41<T extends Thing>(x: Readonly<Thing>, y: Readonly<T>): void;
311317
declare type Item = {
312318
name: string;
313319
};

0 commit comments

Comments
 (0)