Skip to content

Commit e262f49

Browse files
committed
Accept new baselines
1 parent 27a80c1 commit e262f49

File tree

2 files changed

+62
-48
lines changed

2 files changed

+62
-48
lines changed

tests/baselines/reference/keyofAndIndexedAccess2.errors.txt

+18-4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,24 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(67,3): error TS232
2626
tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(68,3): error TS2322: Type '123' is not assignable to type 'T[K]'.
2727
tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(108,5): error TS2322: Type '123' is not assignable to type 'Type[K]'.
2828
Type '123' is not assignable to type 'never'.
29+
tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(126,1): error TS2322: Type 'Demo<{ b: string; }>' is not assignable to type 'Demo<{ a: number; }>'.
30+
Types of parameters 'key' and 'key' are incompatible.
31+
Type '"a"' is not assignable to type '"b"'.
32+
tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(127,1): error TS2322: Type 'Demo<{ a: number; b: string; }>' is not assignable to type 'Demo<{ a: number; }>'.
33+
Property 'b' is missing in type '{ a: number; }' but required in type '{ a: number; b: string; }'.
34+
tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(128,1): error TS2322: Type 'Demo<{ a: number; }>' is not assignable to type 'Demo<{ b: string; }>'.
35+
Types of parameters 'key' and 'key' are incompatible.
36+
Type '"b"' is not assignable to type '"a"'.
37+
tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(129,1): error TS2322: Type 'Demo<{ a: number; b: string; }>' is not assignable to type 'Demo<{ b: string; }>'.
38+
Property 'a' is missing in type '{ b: string; }' but required in type '{ a: number; b: string; }'.
39+
tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(130,1): error TS2322: Type 'Demo<{ a: number; }>' is not assignable to type 'Demo<{ a: number; b: string; }>'.
40+
Types of parameters 'key' and 'key' are incompatible.
41+
Type '"a" | "b"' is not assignable to type '"a"'.
42+
Type '"b"' is not assignable to type '"a"'.
43+
tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(131,1): error TS2322: Type 'Demo<{ b: string; }>' is not assignable to type 'Demo<{ a: number; b: string; }>'.
44+
Types of parameters 'key' and 'key' are incompatible.
45+
Type '"a" | "b"' is not assignable to type '"b"'.
46+
Type '"a"' is not assignable to type '"b"'.
2947

3048

3149
==== tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts (29 errors) ====
@@ -210,23 +228,19 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(108,5): error TS23
210228
!!! error TS2322: Type 'Demo<{ b: string; }>' is not assignable to type 'Demo<{ a: number; }>'.
211229
!!! error TS2322: Types of parameters 'key' and 'key' are incompatible.
212230
!!! error TS2322: Type '"a"' is not assignable to type '"b"'.
213-
!!! related TS2728 tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts:122:24: 'a' is declared here.
214231
da = dc;
215232
~~
216233
!!! error TS2322: Type 'Demo<{ a: number; b: string; }>' is not assignable to type 'Demo<{ a: number; }>'.
217234
!!! error TS2322: Property 'b' is missing in type '{ a: number; }' but required in type '{ a: number; b: string; }'.
218-
!!! related TS2728 tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts:124:35: 'b' is declared here.
219235
db = da; // Error
220236
~~
221237
!!! error TS2322: Type 'Demo<{ a: number; }>' is not assignable to type 'Demo<{ b: string; }>'.
222238
!!! error TS2322: Types of parameters 'key' and 'key' are incompatible.
223239
!!! error TS2322: Type '"b"' is not assignable to type '"a"'.
224-
!!! related TS2728 tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts:123:24: 'b' is declared here.
225240
db = dc;
226241
~~
227242
!!! error TS2322: Type 'Demo<{ a: number; b: string; }>' is not assignable to type 'Demo<{ b: string; }>'.
228243
!!! error TS2322: Property 'a' is missing in type '{ b: string; }' but required in type '{ a: number; b: string; }'.
229-
!!! related TS2728 tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts:124:24: 'a' is declared here.
230244
dc = da; // Error
231245
~~
232246
!!! error TS2322: Type 'Demo<{ a: number; }>' is not assignable to type 'Demo<{ a: number; b: string; }>'.

tests/baselines/reference/keyofAndIndexedAccess2.symbols

+44-44
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ export class c {
566566

567567
constructor() {
568568
this.a = "b";
569-
>this : Symbol(c, Decl(keyofAndIndexedAccess2.ts, 136, 1))
569+
>this : Symbol(c, Decl(keyofAndIndexedAccess2.ts, 151, 1))
570570

571571
this["a"] = "b";
572572
>this : Symbol(c, Decl(keyofAndIndexedAccess2.ts, 151, 1))
@@ -576,67 +576,67 @@ export class c {
576576
// Repro from #31385
577577

578578
type Foo<T> = { [key: string]: { [K in keyof T]: K }[keyof T] };
579-
>Foo : Symbol(Foo, Decl(keyofAndIndexedAccess2.ts, 146, 1))
580-
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 150, 9))
581-
>key : Symbol(key, Decl(keyofAndIndexedAccess2.ts, 150, 17))
582-
>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 150, 34))
583-
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 150, 9))
584-
>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 150, 34))
585-
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 150, 9))
579+
>Foo : Symbol(Foo, Decl(keyofAndIndexedAccess2.ts, 161, 1))
580+
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 165, 9))
581+
>key : Symbol(key, Decl(keyofAndIndexedAccess2.ts, 165, 17))
582+
>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 165, 34))
583+
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 165, 9))
584+
>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 165, 34))
585+
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 165, 9))
586586

587587
type Bar<T> = { [key: string]: { [K in keyof T]: [K] }[keyof T] };
588-
>Bar : Symbol(Bar, Decl(keyofAndIndexedAccess2.ts, 150, 64))
589-
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 152, 9))
590-
>key : Symbol(key, Decl(keyofAndIndexedAccess2.ts, 152, 17))
591-
>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 152, 34))
592-
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 152, 9))
593-
>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 152, 34))
594-
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 152, 9))
588+
>Bar : Symbol(Bar, Decl(keyofAndIndexedAccess2.ts, 165, 64))
589+
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 167, 9))
590+
>key : Symbol(key, Decl(keyofAndIndexedAccess2.ts, 167, 17))
591+
>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 167, 34))
592+
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 167, 9))
593+
>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 167, 34))
594+
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 167, 9))
595595

596596
type Baz<T, Q extends Foo<T>> = { [K in keyof Q]: T[Q[K]] };
597-
>Baz : Symbol(Baz, Decl(keyofAndIndexedAccess2.ts, 152, 66))
598-
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 154, 9))
599-
>Q : Symbol(Q, Decl(keyofAndIndexedAccess2.ts, 154, 11))
600-
>Foo : Symbol(Foo, Decl(keyofAndIndexedAccess2.ts, 146, 1))
601-
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 154, 9))
602-
>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 154, 35))
603-
>Q : Symbol(Q, Decl(keyofAndIndexedAccess2.ts, 154, 11))
604-
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 154, 9))
605-
>Q : Symbol(Q, Decl(keyofAndIndexedAccess2.ts, 154, 11))
606-
>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 154, 35))
597+
>Baz : Symbol(Baz, Decl(keyofAndIndexedAccess2.ts, 167, 66))
598+
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 169, 9))
599+
>Q : Symbol(Q, Decl(keyofAndIndexedAccess2.ts, 169, 11))
600+
>Foo : Symbol(Foo, Decl(keyofAndIndexedAccess2.ts, 161, 1))
601+
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 169, 9))
602+
>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 169, 35))
603+
>Q : Symbol(Q, Decl(keyofAndIndexedAccess2.ts, 169, 11))
604+
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 169, 9))
605+
>Q : Symbol(Q, Decl(keyofAndIndexedAccess2.ts, 169, 11))
606+
>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 169, 35))
607607

608608
type Qux<T, Q extends Bar<T>> = { [K in keyof Q]: T[Q[K]["0"]] };
609-
>Qux : Symbol(Qux, Decl(keyofAndIndexedAccess2.ts, 154, 60))
610-
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 156, 9))
611-
>Q : Symbol(Q, Decl(keyofAndIndexedAccess2.ts, 156, 11))
612-
>Bar : Symbol(Bar, Decl(keyofAndIndexedAccess2.ts, 150, 64))
613-
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 156, 9))
614-
>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 156, 35))
615-
>Q : Symbol(Q, Decl(keyofAndIndexedAccess2.ts, 156, 11))
616-
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 156, 9))
617-
>Q : Symbol(Q, Decl(keyofAndIndexedAccess2.ts, 156, 11))
618-
>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 156, 35))
609+
>Qux : Symbol(Qux, Decl(keyofAndIndexedAccess2.ts, 169, 60))
610+
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 171, 9))
611+
>Q : Symbol(Q, Decl(keyofAndIndexedAccess2.ts, 171, 11))
612+
>Bar : Symbol(Bar, Decl(keyofAndIndexedAccess2.ts, 165, 64))
613+
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 171, 9))
614+
>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 171, 35))
615+
>Q : Symbol(Q, Decl(keyofAndIndexedAccess2.ts, 171, 11))
616+
>T : Symbol(T, Decl(keyofAndIndexedAccess2.ts, 171, 9))
617+
>Q : Symbol(Q, Decl(keyofAndIndexedAccess2.ts, 171, 11))
618+
>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 171, 35))
619619

620620
// Repro from #32038
621621

622622
const actions = ['resizeTo', 'resizeBy'] as const;
623-
>actions : Symbol(actions, Decl(keyofAndIndexedAccess2.ts, 160, 5))
623+
>actions : Symbol(actions, Decl(keyofAndIndexedAccess2.ts, 175, 5))
624624

625625
for (const action of actions) {
626-
>action : Symbol(action, Decl(keyofAndIndexedAccess2.ts, 161, 10))
627-
>actions : Symbol(actions, Decl(keyofAndIndexedAccess2.ts, 160, 5))
626+
>action : Symbol(action, Decl(keyofAndIndexedAccess2.ts, 176, 10))
627+
>actions : Symbol(actions, Decl(keyofAndIndexedAccess2.ts, 175, 5))
628628

629629
window[action] = (x, y) => {
630630
>window : Symbol(window, Decl(lib.dom.d.ts, --, --))
631-
>action : Symbol(action, Decl(keyofAndIndexedAccess2.ts, 161, 10))
632-
>x : Symbol(x, Decl(keyofAndIndexedAccess2.ts, 162, 19))
633-
>y : Symbol(y, Decl(keyofAndIndexedAccess2.ts, 162, 21))
631+
>action : Symbol(action, Decl(keyofAndIndexedAccess2.ts, 176, 10))
632+
>x : Symbol(x, Decl(keyofAndIndexedAccess2.ts, 177, 19))
633+
>y : Symbol(y, Decl(keyofAndIndexedAccess2.ts, 177, 21))
634634

635635
window[action](x, y);
636636
>window : Symbol(window, Decl(lib.dom.d.ts, --, --))
637-
>action : Symbol(action, Decl(keyofAndIndexedAccess2.ts, 161, 10))
638-
>x : Symbol(x, Decl(keyofAndIndexedAccess2.ts, 162, 19))
639-
>y : Symbol(y, Decl(keyofAndIndexedAccess2.ts, 162, 21))
637+
>action : Symbol(action, Decl(keyofAndIndexedAccess2.ts, 176, 10))
638+
>x : Symbol(x, Decl(keyofAndIndexedAccess2.ts, 177, 19))
639+
>y : Symbol(y, Decl(keyofAndIndexedAccess2.ts, 177, 21))
640640
}
641641
}
642642

0 commit comments

Comments
 (0)