Skip to content

Commit f5f1f30

Browse files
committed
Accept new baselines
1 parent d69aeb4 commit f5f1f30

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

tests/baselines/reference/indexSignatureAndMappedType.errors.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1+
tests/cases/compiler/indexSignatureAndMappedType.ts(6,5): error TS2322: Type '{ [key: string]: T; }' is not assignable to type 'Record<K, T>'.
12
tests/cases/compiler/indexSignatureAndMappedType.ts(15,5): error TS2322: Type 'Record<K, U>' is not assignable to type '{ [key: string]: T; }'.
23
Type 'U' is not assignable to type 'T'.
34
tests/cases/compiler/indexSignatureAndMappedType.ts(16,5): error TS2322: Type '{ [key: string]: T; }' is not assignable to type 'Record<K, U>'.
45

56

6-
==== tests/cases/compiler/indexSignatureAndMappedType.ts (2 errors) ====
7+
==== tests/cases/compiler/indexSignatureAndMappedType.ts (3 errors) ====
78
// A mapped type { [P in K]: X }, where K is a generic type, is related to
89
// { [key: string]: Y } if X is related to Y.
910

1011
function f1<T, K extends string>(x: { [key: string]: T }, y: Record<K, T>) {
1112
x = y;
1213
y = x; // Error
14+
~
15+
!!! error TS2322: Type '{ [key: string]: T; }' is not assignable to type 'Record<K, T>'.
1316
}
1417

1518
function f2<T>(x: { [key: string]: T }, y: Record<string, T>) {

tests/baselines/reference/keyofAndIndexedAccessErrors.errors.txt

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,15 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(117,5): error
6363
Type 'T' is not assignable to type 'U'.
6464
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(122,5): error TS2322: Type '42' is not assignable to type 'keyof T'.
6565
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(123,5): error TS2322: Type '"hello"' is not assignable to type 'keyof T'.
66+
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(140,5): error TS2322: Type '42' is not assignable to type 'T[K]'.
67+
Type '42' is not assignable to type 'T[string]'.
68+
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(141,5): error TS2322: Type '"hello"' is not assignable to type 'T[K]'.
69+
Type '"hello"' is not assignable to type 'T[string]'.
70+
tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(142,5): error TS2322: Type 'number[]' is not assignable to type 'T[K]'.
71+
Type 'number[]' is not assignable to type 'T[string]'.
6672

6773

68-
==== tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts (38 errors) ====
74+
==== tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts (41 errors) ====
6975
class Shape {
7076
name: string;
7177
width: number;
@@ -309,8 +315,17 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts(123,5): error
309315

310316
function test1<T extends Record<string, any>, K extends keyof T>(t: T, k: K) {
311317
t[k] = 42; // Error
318+
~~~~
319+
!!! error TS2322: Type '42' is not assignable to type 'T[K]'.
320+
!!! error TS2322: Type '42' is not assignable to type 'T[string]'.
312321
t[k] = "hello"; // Error
322+
~~~~
323+
!!! error TS2322: Type '"hello"' is not assignable to type 'T[K]'.
324+
!!! error TS2322: Type '"hello"' is not assignable to type 'T[string]'.
313325
t[k] = [10, 20]; // Error
326+
~~~~
327+
!!! error TS2322: Type 'number[]' is not assignable to type 'T[K]'.
328+
!!! error TS2322: Type 'number[]' is not assignable to type 'T[string]'.
314329
}
315330

316331
// Repro from #28839

tests/baselines/reference/nonPrimitiveConstraintOfIndexAccessType.errors.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessTy
1717
tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts(30,5): error TS2322: Type 'string' is not assignable to type 'T[P]'.
1818
Type 'string' is not assignable to type 'T[string] & T[number]'.
1919
Type 'string' is not assignable to type 'T[string]'.
20-
Type 'string' is not assignable to type 'number'.
2120

2221

2322
==== tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessType.ts (10 errors) ====
@@ -80,6 +79,5 @@ tests/cases/conformance/types/nonPrimitive/nonPrimitiveConstraintOfIndexAccessTy
8079
!!! error TS2322: Type 'string' is not assignable to type 'T[P]'.
8180
!!! error TS2322: Type 'string' is not assignable to type 'T[string] & T[number]'.
8281
!!! error TS2322: Type 'string' is not assignable to type 'T[string]'.
83-
!!! error TS2322: Type 'string' is not assignable to type 'number'.
8482
}
8583

0 commit comments

Comments
 (0)