Update tests

This commit is contained in:
Anders Hejlsberg 2018-12-11 15:12:47 -08:00
parent 0dcaaa5c50
commit 77d01ab332
2 changed files with 3 additions and 9 deletions

View file

@ -486,10 +486,10 @@ function onChangeGenericFunction<T>(handler: Handler<T & {preset: number}>) {
function updateIds<T extends Record<K, string>, K extends string>(
obj: T,
idFields: K[],
idMapping: { [oldId: string]: string }
idMapping: Partial<Record<T[K], T[K]>>
): Record<K, string> {
for (const idField of idFields) {
const newId = idMapping[obj[idField]];
const newId: T[K] | undefined = idMapping[obj[idField]];
if (newId) {
obj[idField] = newId;
}

View file

@ -148,12 +148,6 @@ function f30<T, K extends keyof T>() {
let x: Partial<Record<keyof T, string>>[K] = "hello";
}
// We simplify indexed accesses applied to mapped types up to five levels deep
function f31<T, K extends keyof T>() {
let x: Partial<Partial<Partial<Partial<Record<keyof T, string>>>>>[K] = "hello";
}
function f32<T, K extends keyof T>() {
let x: Partial<Partial<Partial<Partial<Partial<Record<keyof T, string>>>>>>[K] = "hello";
let x: Partial<Partial<Partial<Partial<Partial<Partial<Partial<Record<keyof T, string>>>>>>>>[K] = "hello";
}