File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -14502,16 +14502,10 @@ namespace ts {
14502
14502
}
14503
14503
14504
14504
function createReverseMappedType(source: Type, target: MappedType, constraint: IndexType) {
14505
- const properties = getPropertiesOfType(source);
14506
- if (properties.length === 0 && !getIndexInfoOfType(source, IndexKind.String)) {
14507
- return undefined;
14508
- }
14509
14505
// If any property contains context sensitive functions that have been skipped, the source type
14510
14506
// is incomplete and we can't infer a meaningful input type.
14511
- for (const prop of properties) {
14512
- if (getObjectFlags(getTypeOfSymbol(prop)) & ObjectFlags.NonInferrableType) {
14513
- return undefined;
14514
- }
14507
+ if (getObjectFlags(source) & ObjectFlags.NonInferrableType || getPropertiesOfType(source).length === 0 && !getIndexInfoOfType(source, IndexKind.String)) {
14508
+ return undefined;
14515
14509
}
14516
14510
// For arrays and tuples we infer new arrays and tuples where the reverse mapping has been
14517
14511
// applied to the element type(s).
You can’t perform that action at this time.
0 commit comments