Distributed: Fixes for non-copyable generics

This commit is contained in:
Slava Pestov
2024-01-30 17:09:07 -05:00
parent 778e6d5fcb
commit 4a46717325
4 changed files with 51 additions and 17 deletions

View File

@@ -98,11 +98,14 @@ void SILGenFunction::emitDistributedIfRemoteBranch(SILLocation Loc,
assert(isRemoteFn && "Could not find 'is remote' function, is the "
"'Distributed' module available?");
auto conformances = SGM.M.getSwiftModule()->collectExistentialConformances(
selfTy->getCanonicalType(), ctx.getAnyObjectType());
ManagedValue selfAnyObject = B.createInitExistentialRef(
Loc,
/*existentialType=*/getLoweredType(ctx.getAnyObjectType()),
/*formalConcreteType=*/selfValue.getType().getASTType(),
selfValue, {});
/*formalConcreteType=*/selfTy->getCanonicalType(),
selfValue, conformances);
auto result = emitApplyOfLibraryIntrinsic(
Loc, isRemoteFn, SubstitutionMap(), {selfAnyObject}, SGFContext());