mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Distributed] fix how we locate the system property;
This commit is contained in:
@@ -145,10 +145,19 @@ VarDecl *GetDistributedActorSystemPropertyRequest::evaluate(
|
|||||||
if (!C.getLoadedModule(C.Id_Distributed))
|
if (!C.getLoadedModule(C.Id_Distributed))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
|
auto module = C.getStdlibModule();
|
||||||
|
auto DistSystemProtocol =
|
||||||
|
C.getProtocol(KnownProtocolKind::DistributedActorSystem);
|
||||||
|
|
||||||
if (auto system = actor->lookupDirect(C.Id_actorSystem).begin()) {
|
for (auto system : actor->lookupDirect(C.Id_actorSystem)) {
|
||||||
// TODO(distributed): may need to check conformance here?
|
if (auto var = dyn_cast<VarDecl>(system)) {
|
||||||
return dyn_cast<VarDecl>(*system);
|
auto conformance = module->conformsToProtocol(var->getInterfaceType(),
|
||||||
|
DistSystemProtocol);
|
||||||
|
if (conformance.isInvalid())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
return var;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|||||||
Reference in New Issue
Block a user