You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -24511,6 +24511,15 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
24511
24511
}
24512
24512
}
24513
24513
}
24514
+
// The following is a targeted fix to allow higher-kinded types to be emulated using the technique in #53970.
24515
+
// Specifically, when an indexed access type was deferred because it has a reducible object type, here we force
24516
+
// resolution of the type and then infer to the result.
24517
+
if (target.flags & TypeFlags.IndexedAccess && isGenericReducibleType((target as IndexedAccessType).objectType)) {
24518
+
const instantiated = getIndexedAccessType((target as IndexedAccessType).objectType, (target as IndexedAccessType).indexType, AccessFlags.ResolveReducibleTypes);
24519
+
if (instantiated && instantiated !== target) {
24520
+
inferFromTypes(source, instantiated);
24521
+
}
24522
+
}
24514
24523
}
24515
24524
if (getObjectFlags(source) & ObjectFlags.Reference && getObjectFlags(target) & ObjectFlags.Reference && (
24516
24525
(source as TypeReference).target === (target as TypeReference).target || isArrayType(source) && isArrayType(target)) &&
0 commit comments