Skip to content

Commit efa16ac

Browse files
committed
Address CR feedback
1 parent 436f606 commit efa16ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/checker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14960,8 +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 indexType = source.symbol && source.symbol.flags & SymbolFlags.Enum && getEnumKind(source.symbol) === EnumKind.Literal ?
14964-
undefined : getIndexTypeOfType(source, IndexKind.String) || getIndexTypeOfType(source, IndexKind.Number);
14963+
const indexInfo = getIndexInfoOfType(source, IndexKind.String) || getIndexInfoOfType(source, IndexKind.Number);
14964+
const indexType = indexInfo && indexInfo !== enumNumberIndexInfo ? indexInfo.type : undefined;
1496514965
const sourcePropsType = indexType || getUnionType(map(getPropertiesOfType(source), getTypeOfSymbol));
1496614966
inferFromTypes(sourcePropsType, getTemplateTypeFromMappedType(target));
1496714967
return true;

0 commit comments

Comments
 (0)