From 77d01ab332bce00322a0c76c5a94e77e45abf9db Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 11 Dec 2018 15:12:47 -0800 Subject: [PATCH] Update tests --- .../conformance/types/keyof/keyofAndIndexedAccess.ts | 4 ++-- .../types/keyof/keyofAndIndexedAccessErrors.ts | 8 +------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts b/tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts index cf05bdfed81..b498310f13b 100644 --- a/tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts +++ b/tests/cases/conformance/types/keyof/keyofAndIndexedAccess.ts @@ -486,10 +486,10 @@ function onChangeGenericFunction(handler: Handler) { function updateIds, K extends string>( obj: T, idFields: K[], - idMapping: { [oldId: string]: string } + idMapping: Partial> ): Record { for (const idField of idFields) { - const newId = idMapping[obj[idField]]; + const newId: T[K] | undefined = idMapping[obj[idField]]; if (newId) { obj[idField] = newId; } diff --git a/tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts b/tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts index a179935d0ec..d5fe7c24b5c 100644 --- a/tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts +++ b/tests/cases/conformance/types/keyof/keyofAndIndexedAccessErrors.ts @@ -148,12 +148,6 @@ 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"; + let x: Partial>>>>>>>[K] = "hello"; }