@@ -1605,8 +1605,33 @@ static ManagedValue emitBuiltinCreateAsyncTaskInGroup(
1605
1605
SGF.B .createMetatype (loc, SGF.getLoweredType (futureResultType)));
1606
1606
}).borrow (SGF, loc).forward (SGF);
1607
1607
1608
- auto function = emitFunctionArgumentForAsyncTaskEntryPoint (SGF, loc, args[2 ],
1609
- futureResultType);
1608
+ // FIXME(katei): This is a hack to fix the ABI signature mismatch issue
1609
+ // https://github.com/apple/swift/issues/63060
1610
+ // ==================== BEGIN HACK ====================
1611
+ // Ensure that the closure has the appropriate type.
1612
+ auto extInfo =
1613
+ ASTExtInfoBuilder ()
1614
+ .withAsync ()
1615
+ .withThrows ()
1616
+ .withRepresentation (GenericFunctionType::Representation::Swift)
1617
+ .build ();
1618
+ auto genericSig = subs.getGenericSignature ().getCanonicalSignature ();
1619
+ auto genericResult =
1620
+ GenericTypeParamType::get (/* isParameterPack*/ false ,
1621
+ /* depth*/ 0 , /* index*/ 0 , SGF.getASTContext ());
1622
+ // <T> () async throws -> Void
1623
+ CanType functionTy =
1624
+ GenericFunctionType::get (genericSig, {}, genericResult, extInfo)
1625
+ ->getCanonicalType ();
1626
+ AbstractionPattern origParam (genericSig, functionTy);
1627
+ CanType substParamType = functionTy.subst (subs)->getCanonicalType ();
1628
+ auto reabstractedFun =
1629
+ SGF.emitSubstToOrigValue (loc, args[2 ], origParam, substParamType);
1630
+ // ==================== END HACK ======================
1631
+
1632
+ auto function = emitFunctionArgumentForAsyncTaskEntryPoint (
1633
+ SGF, loc, reabstractedFun, futureResultType);
1634
+
1610
1635
auto apply = SGF.B .createBuiltin (
1611
1636
loc,
1612
1637
ctx.getIdentifier (
0 commit comments