@@ -552,6 +552,7 @@ class EmitPolymorphicParameters : public PolymorphicConvention {
552
552
// `DistributedActorSystem.remoteCall` or
553
553
// `DistributedTargetInvocationEncoder.record{Argument, ReturnType}`
554
554
// `DistributedTargetInvocationDecoder.decodeNextArgument`
555
+ // `DistributedTargetInvocationResultHandler.onReturn`
555
556
// requirements we need to supply witness tables associated with `Res`,
556
557
// `Argument`, `R` generic parameters which are not expressible on the
557
558
// protocol requirement because they come from `SerializationRequirement`
@@ -752,19 +753,21 @@ void EmitPolymorphicParameters::injectAdHocDistributedRequirements() {
752
753
genericParam = funcDecl->getResultInterfaceType ();
753
754
}
754
755
756
+ auto sig = funcDecl->getGenericSignature ();
757
+
755
758
// DistributedTargetInvocationEncoder.record{Argument, ReturnType}
756
759
// DistributedTargetInvocationDecoder.decodeNextArgument
760
+ // DistributedTargetInvocationResultHandler.onReturn
757
761
if (funcDecl->isDistributedTargetInvocationEncoderRecordArgument () ||
758
762
funcDecl->isDistributedTargetInvocationEncoderRecordReturnType () ||
759
- funcDecl->isDistributedTargetInvocationDecoderDecodeNextArgument ()) {
760
- auto *argParam = funcDecl->getGenericParams ()-> getParams (). front ();
761
- genericParam = argParam-> getDeclaredInterfaceType ();
763
+ funcDecl->isDistributedTargetInvocationDecoderDecodeNextArgument () ||
764
+ funcDecl->isDistributedTargetInvocationResultHandlerOnReturn ()) {
765
+ genericParam = sig. getInnermostGenericParams (). front ();
762
766
}
763
767
764
768
if (!genericParam)
765
769
return ;
766
770
767
- auto sig = funcDecl->getGenericSignature ();
768
771
auto requirements = sig->getLocalRequirements (genericParam);
769
772
if (requirements.protos .empty ())
770
773
return ;
0 commit comments