Skip to content

Commit 3435451

Browse files
committed
Even more succinct
1 parent efa16ac commit 3435451

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14960,9 +14960,8 @@ namespace ts {
1496014960
}
1496114961
// If no inferences can be made to K's constraint, infer from a union of the property types
1496214962
// in the source to the template type X.
14963-
const indexInfo = getIndexInfoOfType(source, IndexKind.String) || getIndexInfoOfType(source, IndexKind.Number);
14964-
const indexType = indexInfo && indexInfo !== enumNumberIndexInfo ? indexInfo.type : undefined;
14965-
const sourcePropsType = indexType || getUnionType(map(getPropertiesOfType(source), getTypeOfSymbol));
14963+
const indexInfo = getIndexInfoOfType(source, IndexKind.String) || getNonEnumNumberIndexInfo(source);
14964+
const sourcePropsType = indexInfo && indexInfo.type || getUnionType(map(getPropertiesOfType(source), getTypeOfSymbol));
1496614965
inferFromTypes(sourcePropsType, getTemplateTypeFromMappedType(target));
1496714966
return true;
1496814967
}

0 commit comments

Comments
 (0)