@@ -3625,13 +3625,12 @@ static Optional<ActorIsolation> getIsolationFromWrappers(
3625
3625
3626
3626
ASTContext &ctx = nominal->getASTContext ();
3627
3627
if (ctx.isSwiftVersionAtLeast (6 )) {
3628
- // In Swift 6, we no longer infer isolation of a nominal type based
3629
- // on property wrappers used in its stored properties
3628
+ // In Swift 6, we no longer infer isolation of a nominal type
3629
+ // based on the property wrappers used in its stored properties
3630
3630
return None;
3631
3631
}
3632
3632
3633
- Optional<std::pair<ActorIsolation, Type>> foundIsolationAndType;
3634
-
3633
+ Optional<ActorIsolation> foundIsolation;
3635
3634
for (auto member : nominal->getMembers ()) {
3636
3635
auto var = dyn_cast<VarDecl>(member);
3637
3636
if (!var || !var->isInstanceMember ())
@@ -3656,36 +3655,19 @@ static Optional<ActorIsolation> getIsolationFromWrappers(
3656
3655
3657
3656
case ActorIsolation::GlobalActor:
3658
3657
case ActorIsolation::GlobalActorUnsafe:
3659
- if (!foundIsolationAndType) {
3660
- if (auto propertyWrapperType = var->getAttachedPropertyWrapperType (0 )) {
3661
- foundIsolationAndType = { isolation, propertyWrapperType };
3662
- continue ;
3663
- }
3658
+ if (!foundIsolation) {
3659
+ foundIsolation = isolation;
3660
+ continue ;
3664
3661
}
3665
3662
3666
- if (foundIsolationAndType-> first != isolation)
3663
+ if (*foundIsolation != isolation)
3667
3664
return None;
3668
3665
3669
3666
break ;
3670
3667
}
3671
3668
}
3672
3669
3673
- if (foundIsolationAndType) {
3674
- // We are inferring isolation for the type because
3675
- // it contains an actor-isolated property wrapper.
3676
- // Warn that this inferrence will be going away in
3677
- // Swift 6
3678
- const ActorIsolation isolation = foundIsolationAndType->first ;
3679
- const Type type = foundIsolationAndType->second ;
3680
-
3681
- nominal->diagnose (diag::actor_isolation_inferred_from_property_wrapper,
3682
- nominal->getName (), isolation, " '@" +type->getString ()+" '" )
3683
- .fixItInsert (nominal->getAttributeInsertionLoc (false ), " @" + isolation.getGlobalActor ().getString ());
3684
- return isolation;
3685
- }
3686
- else {
3687
- return None;
3688
- }
3670
+ return foundIsolation;
3689
3671
}
3690
3672
3691
3673
namespace {
0 commit comments