@@ -3452,13 +3452,12 @@ static Optional<ActorIsolation> getIsolationFromWrappers(
3452
3452
3453
3453
ASTContext &ctx = nominal->getASTContext ();
3454
3454
if (ctx.isSwiftVersionAtLeast (6 )) {
3455
- // In Swift 6, we no longer infer isolation of a nominal type based
3456
- // on property wrappers used in its stored properties
3455
+ // In Swift 6, we no longer infer isolation of a nominal type
3456
+ // based on the property wrappers used in its stored properties
3457
3457
return None;
3458
3458
}
3459
3459
3460
- Optional<std::pair<ActorIsolation, Type>> foundIsolationAndType;
3461
-
3460
+ Optional<ActorIsolation> foundIsolation;
3462
3461
for (auto member : nominal->getMembers ()) {
3463
3462
auto var = dyn_cast<VarDecl>(member);
3464
3463
if (!var || !var->isInstanceMember ())
@@ -3483,36 +3482,19 @@ static Optional<ActorIsolation> getIsolationFromWrappers(
3483
3482
3484
3483
case ActorIsolation::GlobalActor:
3485
3484
case ActorIsolation::GlobalActorUnsafe:
3486
- if (!foundIsolationAndType) {
3487
- if (auto propertyWrapperType = var->getAttachedPropertyWrapperType (0 )) {
3488
- foundIsolationAndType = { isolation, propertyWrapperType };
3489
- continue ;
3490
- }
3485
+ if (!foundIsolation) {
3486
+ foundIsolation = isolation;
3487
+ continue ;
3491
3488
}
3492
3489
3493
- if (foundIsolationAndType-> first != isolation)
3490
+ if (*foundIsolation != isolation)
3494
3491
return None;
3495
3492
3496
3493
break ;
3497
3494
}
3498
3495
}
3499
3496
3500
- if (foundIsolationAndType) {
3501
- // We are inferring isolation for the type because
3502
- // it contains an actor-isolated property wrapper.
3503
- // Warn that this inferrence will be going away in
3504
- // Swift 6
3505
- const ActorIsolation isolation = foundIsolationAndType->first ;
3506
- const Type type = foundIsolationAndType->second ;
3507
-
3508
- nominal->diagnose (diag::actor_isolation_inferred_from_property_wrapper,
3509
- nominal->getName (), isolation, " '@" +type->getString ()+" '" )
3510
- .fixItInsert (nominal->getAttributeInsertionLoc (false ), " @" + isolation.getGlobalActor ().getString ());
3511
- return isolation;
3512
- }
3513
- else {
3514
- return None;
3515
- }
3497
+ return foundIsolation;
3516
3498
}
3517
3499
3518
3500
namespace {
0 commit comments