Skip to content

Commit 77d01ab

Browse files
committed
Update tests
1 parent 0dcaaa5 commit 77d01ab

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,10 +486,10 @@ function onChangeGenericFunction<T>(handler: Handler<T & {preset: number}>) {
486486
function updateIds<T extends Record<K, string>, K extends string>(
487487
obj: T,
488488
idFields: K[],
489-
idMapping: { [oldId: string]: string }
489+
idMapping: Partial<Record<T[K], T[K]>>
490490
): Record<K, string> {
491491
for (const idField of idFields) {
492-
const newId = idMapping[obj[idField]];
492+
const newId: T[K] | undefined = idMapping[obj[idField]];
493493
if (newId) {
494494
obj[idField] = newId;
495495
}

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,6 @@ function f30<T, K extends keyof T>() {
148148
let x: Partial<Record<keyof T, string>>[K] = "hello";
149149
}
150150

151-
// We simplify indexed accesses applied to mapped types up to five levels deep
152-
153151
function f31<T, K extends keyof T>() {
154-
let x: Partial<Partial<Partial<Partial<Record<keyof T, string>>>>>[K] = "hello";
155-
}
156-
157-
function f32<T, K extends keyof T>() {
158-
let x: Partial<Partial<Partial<Partial<Partial<Record<keyof T, string>>>>>>[K] = "hello";
152+
let x: Partial<Partial<Partial<Partial<Partial<Partial<Partial<Record<keyof T, string>>>>>>>>[K] = "hello";
159153
}

0 commit comments

Comments
 (0)