File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -25256,6 +25256,17 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
25256
25256
inferToTemplateLiteralType(source, target as TemplateLiteralType);
25257
25257
}
25258
25258
else {
25259
+ if (isGenericMappedType(source) && isGenericMappedType(target)) {
25260
+ invokeOnce(source, target, (source, target) => {
25261
+ // The source and target types are generic types { [P in S]: X } and { [P in T]: Y }, so we infer
25262
+ // from S to T and from X to Y.
25263
+ inferFromTypes(getConstraintTypeFromMappedType(source), getConstraintTypeFromMappedType(target));
25264
+ inferFromTypes(getTemplateTypeFromMappedType(source), getTemplateTypeFromMappedType(target));
25265
+ const sourceNameType = getNameTypeFromMappedType(source);
25266
+ const targetNameType = getNameTypeFromMappedType(target);
25267
+ if (sourceNameType && targetNameType) inferFromTypes(sourceNameType, targetNameType);
25268
+ });
25269
+ }
25259
25270
source = getReducedType(source);
25260
25271
if (!(priority & InferencePriority.NoConstraints && source.flags & (TypeFlags.Intersection | TypeFlags.Instantiable))) {
25261
25272
const apparentSource = getApparentType(source);
You can’t perform that action at this time.
0 commit comments