mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +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))
|
||||
return nullptr;
|
||||
|
||||
auto module = C.getStdlibModule();
|
||||
auto DistSystemProtocol =
|
||||
C.getProtocol(KnownProtocolKind::DistributedActorSystem);
|
||||
|
||||
if (auto system = actor->lookupDirect(C.Id_actorSystem).begin()) {
|
||||
// TODO(distributed): may need to check conformance here?
|
||||
return dyn_cast<VarDecl>(*system);
|
||||
for (auto system : actor->lookupDirect(C.Id_actorSystem)) {
|
||||
if (auto var = dyn_cast<VarDecl>(system)) {
|
||||
auto conformance = module->conformsToProtocol(var->getInterfaceType(),
|
||||
DistSystemProtocol);
|
||||
if (conformance.isInvalid())
|
||||
continue;
|
||||
|
||||
return var;
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user