Skip to content

Commit 2fd4aae

Browse files
committed
Add regression test
1 parent 8120094 commit 2fd4aae

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,13 @@ export class c {
147147
this["a"] = "b";
148148
}
149149
}
150+
151+
// Repro from #31385
152+
153+
type Foo<T> = { [key: string]: { [K in keyof T]: K }[keyof T] };
154+
155+
type Bar<T> = { [key: string]: { [K in keyof T]: [K] }[keyof T] };
156+
157+
type Baz<T, Q extends Foo<T>> = { [K in keyof Q]: T[Q[K]] };
158+
159+
type Qux<T, Q extends Bar<T>> = { [K in keyof Q]: T[Q[K]["0"]] };

0 commit comments

Comments
 (0)