@@ -5167,7 +5167,7 @@ getIsolationFromConformances(NominalTypeDecl *nominal) {
5167
5167
5168
5168
std::optional<InferredActorIsolation> foundIsolation;
5169
5169
for (auto conformance :
5170
- nominal->getLocalConformances (ConformanceLookupKind::NonStructural )) {
5170
+ nominal->getLocalConformances (ConformanceLookupKind::OnlyExplicit )) {
5171
5171
5172
5172
// Don't include inherited conformances. If a conformance is inherited
5173
5173
// from a superclass, the isolation of the subclass should be inferred
@@ -5184,35 +5184,19 @@ getIsolationFromConformances(NominalTypeDecl *nominal) {
5184
5184
}
5185
5185
5186
5186
auto *proto = conformance->getProtocol ();
5187
- auto inferredIsolation = getInferredActorIsolation (proto);
5188
- auto protoIsolation = inferredIsolation.isolation ;
5189
- switch (protoIsolation) {
5187
+ switch (auto protoIsolation = getActorIsolation (proto)) {
5190
5188
case ActorIsolation::ActorInstance:
5191
5189
case ActorIsolation::Unspecified:
5190
+ case ActorIsolation::Nonisolated:
5192
5191
case ActorIsolation::CallerIsolationInheriting:
5193
5192
case ActorIsolation::NonisolatedUnsafe:
5194
5193
break ;
5195
- case ActorIsolation::Nonisolated:
5196
- if (inferredIsolation.source .kind == IsolationSource::Kind::Explicit) {
5197
- if (!foundIsolation) {
5198
- // We found an explicitly 'nonisolated' protocol.
5199
- foundIsolation = {
5200
- protoIsolation,
5201
- IsolationSource (proto, IsolationSource::Conformance)};
5202
- }
5203
- continue ;
5204
- } else {
5205
- break ;
5206
- }
5207
5194
5208
5195
case ActorIsolation::Erased:
5209
5196
llvm_unreachable (" protocol cannot have erased isolation" );
5210
5197
5211
5198
case ActorIsolation::GlobalActor:
5212
- // If we encountered an explicit globally isolated conformance, allow it
5213
- // to override the nonisolated isolation kind.
5214
- if (!foundIsolation ||
5215
- conformance->getSourceKind () == ConformanceEntryKind::Explicit) {
5199
+ if (!foundIsolation) {
5216
5200
foundIsolation = {
5217
5201
protoIsolation,
5218
5202
IsolationSource (proto, IsolationSource::Conformance)
0 commit comments