From 2150a64f0cd457a791ac30c8850934cd6ee35704 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 11 Dec 2018 12:11:16 -0800 Subject: [PATCH] Add tests --- .../types/keyof/keyofAndIndexedAccessErrors.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts b/tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts index a4ed608d8e7..a179935d0ec 100644 --- a/tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts +++ b/tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts @@ -141,3 +141,19 @@ function test1, K extends keyof T>(t: T, k: K) { t[k] = "hello"; // Error t[k] = [10, 20]; // Error } + +// Repro from #28839 + +function f30() { + let x: Partial>[K] = "hello"; +} + +// We simplify indexed accesses applied to mapped types up to five levels deep + +function f31() { + let x: Partial>>>>[K] = "hello"; +} + +function f32() { + let x: Partial>>>>>[K] = "hello"; +}