Skip to content

Commit 50fdecc

Browse files
committed
One more iteration
1 parent 3435451 commit 50fdecc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/compiler/checker.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14960,9 +14960,11 @@ 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) || getNonEnumNumberIndexInfo(source);
14964-
const sourcePropsType = indexInfo && indexInfo.type || getUnionType(map(getPropertiesOfType(source), getTypeOfSymbol));
14965-
inferFromTypes(sourcePropsType, getTemplateTypeFromMappedType(target));
14963+
const propTypes = map(getPropertiesOfType(source), getTypeOfSymbol);
14964+
const stringIndexType = getIndexTypeOfType(source, IndexKind.String);
14965+
const numberIndexInfo = getNonEnumNumberIndexInfo(source);
14966+
const numberIndexType = numberIndexInfo && numberIndexInfo.type;
14967+
inferFromTypes(getUnionType(append(append(propTypes, stringIndexType), numberIndexType)), getTemplateTypeFromMappedType(target));
1496614968
return true;
1496714969
}
1496814970
return false;

0 commit comments

Comments
 (0)