@@ -104,6 +104,7 @@ Solution::computeSubstitutions(NullablePtr<ValueDecl> decl,
104
104
subs[opened.first ] = type;
105
105
}
106
106
107
+ auto *DC = constraintSystem->DC ;
107
108
auto lookupConformanceFn =
108
109
[&](CanType original, Type replacement,
109
110
ProtocolDecl *protoType) -> ProtocolConformanceRef {
@@ -114,8 +115,24 @@ Solution::computeSubstitutions(NullablePtr<ValueDecl> decl,
114
115
}
115
116
116
117
// FIXME: Retrieve the conformance from the solution itself.
117
- return getConstraintSystem ().DC ->getParentModule ()->checkConformance (
118
- replacement, protoType);
118
+ auto conformance =
119
+ DC->getParentModule ()->checkConformance (replacement, protoType);
120
+
121
+ if (conformance.isInvalid ()) {
122
+ if (auto *funcDecl = dyn_cast<FuncDecl>(decl.getPtrOrNull ())) {
123
+ if (funcDecl->isDistributedActorSystemRemoteCall (
124
+ /* isVoidResult=*/ false )) {
125
+ // `Res` conformances would be looked by at runtime but are
126
+ // guaranteed to be there by Sema because all distributed
127
+ // methods and accessors are checked to conform to
128
+ // `SerializationRequirement` of `DistributedActorSystem`.
129
+ if (original->isEqual (funcDecl->getResultInterfaceType ()))
130
+ return ProtocolConformanceRef (protoType);
131
+ }
132
+ }
133
+ }
134
+
135
+ return conformance;
119
136
};
120
137
121
138
return SubstitutionMap::get (sig,
0 commit comments