From 2fd4aaee92a17318ad1c45c6f6590bbb8b82d33d Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 22 May 2019 06:54:16 -0700 Subject: [PATCH] Add regression test --- .../conformance/types/keyof/keyofAndIndexedAccess2.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts b/tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts index a99c2b0a7a106..898648cea44fe 100644 --- a/tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts +++ b/tests/cases/conformance/types/keyof/keyofAndIndexedAccess2.ts @@ -147,3 +147,13 @@ export class c { this["a"] = "b"; } } + +// Repro from #31385 + +type Foo = { [key: string]: { [K in keyof T]: K }[keyof T] }; + +type Bar = { [key: string]: { [K in keyof T]: [K] }[keyof T] }; + +type Baz> = { [K in keyof Q]: T[Q[K]] }; + +type Qux> = { [K in keyof Q]: T[Q[K]["0"]] };