Skip to content

Commit be4147d

Browse files
committed
Accept new baselines
1 parent 076d9ad commit be4147d

File tree

4 files changed

+80
-0
lines changed

4 files changed

+80
-0
lines changed

tests/baselines/reference/keyofAndIndexedAccess2.errors.txt

+9
Original file line numberDiff line numberDiff line change
@@ -237,4 +237,13 @@ tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts(108,5): error TS23
237237
type Baz<T, Q extends Foo<T>> = { [K in keyof Q]: T[Q[K]] };
238238

239239
type Qux<T, Q extends Bar<T>> = { [K in keyof Q]: T[Q[K]["0"]] };
240+
241+
// Repro from #32038
242+
243+
const actions = ['resizeTo', 'resizeBy'] as const;
244+
for (const action of actions) {
245+
window[action] = (x, y) => {
246+
window[action](x, y);
247+
}
248+
}
240249

tests/baselines/reference/keyofAndIndexedAccess2.js

+16
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,15 @@ type Bar<T> = { [key: string]: { [K in keyof T]: [K] }[keyof T] };
156156
type Baz<T, Q extends Foo<T>> = { [K in keyof Q]: T[Q[K]] };
157157

158158
type Qux<T, Q extends Bar<T>> = { [K in keyof Q]: T[Q[K]["0"]] };
159+
160+
// Repro from #32038
161+
162+
const actions = ['resizeTo', 'resizeBy'] as const;
163+
for (const action of actions) {
164+
window[action] = (x, y) => {
165+
window[action](x, y);
166+
}
167+
}
159168

160169

161170
//// [keyofAndIndexedAccess2.js]
@@ -253,3 +262,10 @@ export class c {
253262
this["a"] = "b";
254263
}
255264
}
265+
// Repro from #32038
266+
const actions = ['resizeTo', 'resizeBy'];
267+
for (const action of actions) {
268+
window[action] = (x, y) => {
269+
window[action](x, y);
270+
};
271+
}

tests/baselines/reference/keyofAndIndexedAccess2.symbols

+23
Original file line numberDiff line numberDiff line change
@@ -564,3 +564,26 @@ type Qux<T, Q extends Bar<T>> = { [K in keyof Q]: T[Q[K]["0"]] };
564564
>Q : Symbol(Q, Decl(keyofAndIndexedAccess2.ts, 156, 11))
565565
>K : Symbol(K, Decl(keyofAndIndexedAccess2.ts, 156, 35))
566566

567+
// Repro from #32038
568+
569+
const actions = ['resizeTo', 'resizeBy'] as const;
570+
>actions : Symbol(actions, Decl(keyofAndIndexedAccess2.ts, 160, 5))
571+
572+
for (const action of actions) {
573+
>action : Symbol(action, Decl(keyofAndIndexedAccess2.ts, 161, 10))
574+
>actions : Symbol(actions, Decl(keyofAndIndexedAccess2.ts, 160, 5))
575+
576+
window[action] = (x, y) => {
577+
>window : Symbol(window, Decl(lib.dom.d.ts, --, --))
578+
>action : Symbol(action, Decl(keyofAndIndexedAccess2.ts, 161, 10))
579+
>x : Symbol(x, Decl(keyofAndIndexedAccess2.ts, 162, 19))
580+
>y : Symbol(y, Decl(keyofAndIndexedAccess2.ts, 162, 21))
581+
582+
window[action](x, y);
583+
>window : Symbol(window, Decl(lib.dom.d.ts, --, --))
584+
>action : Symbol(action, Decl(keyofAndIndexedAccess2.ts, 161, 10))
585+
>x : Symbol(x, Decl(keyofAndIndexedAccess2.ts, 162, 19))
586+
>y : Symbol(y, Decl(keyofAndIndexedAccess2.ts, 162, 21))
587+
}
588+
}
589+

tests/baselines/reference/keyofAndIndexedAccess2.types

+32
Original file line numberDiff line numberDiff line change
@@ -540,3 +540,35 @@ type Baz<T, Q extends Foo<T>> = { [K in keyof Q]: T[Q[K]] };
540540
type Qux<T, Q extends Bar<T>> = { [K in keyof Q]: T[Q[K]["0"]] };
541541
>Qux : Qux<T, Q>
542542

543+
// Repro from #32038
544+
545+
const actions = ['resizeTo', 'resizeBy'] as const;
546+
>actions : readonly ["resizeTo", "resizeBy"]
547+
>['resizeTo', 'resizeBy'] as const : readonly ["resizeTo", "resizeBy"]
548+
>['resizeTo', 'resizeBy'] : readonly ["resizeTo", "resizeBy"]
549+
>'resizeTo' : "resizeTo"
550+
>'resizeBy' : "resizeBy"
551+
552+
for (const action of actions) {
553+
>action : "resizeTo" | "resizeBy"
554+
>actions : readonly ["resizeTo", "resizeBy"]
555+
556+
window[action] = (x, y) => {
557+
>window[action] = (x, y) => { window[action](x, y); } : (x: number, y: number) => void
558+
>window[action] : ((x: number, y: number) => void) & ((x: number, y: number) => void)
559+
>window : Window
560+
>action : "resizeTo" | "resizeBy"
561+
>(x, y) => { window[action](x, y); } : (x: number, y: number) => void
562+
>x : number
563+
>y : number
564+
565+
window[action](x, y);
566+
>window[action](x, y) : void
567+
>window[action] : ((x: number, y: number) => void) | ((x: number, y: number) => void)
568+
>window : Window
569+
>action : "resizeTo" | "resizeBy"
570+
>x : number
571+
>y : number
572+
}
573+
}
574+

0 commit comments

Comments
 (0)