[Distributed] make witness be the distributed thunk

This commit is contained in:
Konrad `ktoso` Malawski
2022-06-24 17:45:55 +09:00
parent 0dae89613a
commit 22b20afce6
16 changed files with 365 additions and 30 deletions

View File

@@ -648,8 +648,13 @@ static FuncDecl *createDistributedThunkFunction(FuncDecl *func) {
auto &C = func->getASTContext();
auto DC = func->getDeclContext();
auto systemTy = getConcreteReplacementForProtocolActorSystemType(func);
assert(systemTy &&
// NOTE: So we don't need a thunk in the protocol, we should call the underlying
// thing instead, which MUST have a thunk, since it must be a distributed func as well...
if (dyn_cast<ProtocolDecl>(DC)) {
return nullptr;
}
assert(getConcreteReplacementForProtocolActorSystemType(func) &&
"Thunk synthesis must have concrete actor system type available");
DeclName thunkName = func->getName();