@@ -4819,13 +4819,12 @@ getIsolationFromAttributes(const Decl *decl, bool shouldDiagnose = true,
4819
4819
SourceFile *file = decl->getDeclContext ()->getParentSourceFile ();
4820
4820
bool inSwiftinterface =
4821
4821
file && file->Kind == SourceFileKind::Interface;
4822
- ctx.Diags .diagnose (
4823
- attr->getLocation (),
4824
- diag::unsafe_global_actor)
4825
- .fixItRemove (attr->getArgs ()->getSourceRange ())
4826
- .fixItInsert (attr->getLocation (), " @preconcurrency " )
4827
- .warnUntilSwiftVersion (6 )
4828
- .limitBehaviorIf (inSwiftinterface, DiagnosticBehavior::Ignore);
4822
+ if (!inSwiftinterface) {
4823
+ ctx.Diags .diagnose (attr->getLocation (), diag::unsafe_global_actor)
4824
+ .fixItRemove (attr->getArgs ()->getSourceRange ())
4825
+ .fixItInsert (attr->getLocation (), " @preconcurrency " )
4826
+ .warnUntilSwiftVersion (6 );
4827
+ }
4829
4828
} else {
4830
4829
ctx.Diags .diagnose (
4831
4830
attr->getLocation (),
@@ -6383,11 +6382,14 @@ static bool checkSendableInstanceStorage(
6383
6382
return true ;
6384
6383
}
6385
6384
6386
- property->diagnose (diag::non_concurrent_type_member,
6387
- propertyType, false , property->getName (),
6388
- nominal)
6389
- .limitBehaviorUntilSwiftVersion (behavior, 6 )
6390
- .limitBehaviorIf (preconcurrency);
6385
+ if (preconcurrency)
6386
+ behavior = preconcurrency.value ();
6387
+
6388
+ property
6389
+ ->diagnose (diag::non_concurrent_type_member, propertyType,
6390
+ false , property->getName (), nominal)
6391
+ .limitBehaviorWithPreconcurrency (behavior,
6392
+ preconcurrency.has_value ());
6391
6393
return false ;
6392
6394
});
6393
6395
@@ -6425,10 +6427,14 @@ static bool checkSendableInstanceStorage(
6425
6427
return true ;
6426
6428
}
6427
6429
6428
- element->diagnose (diag::non_concurrent_type_member, type,
6429
- true , element->getName (), nominal)
6430
- .limitBehaviorUntilSwiftVersion (behavior, 6 )
6431
- .limitBehaviorIf (preconcurrency);
6430
+ if (preconcurrency)
6431
+ behavior = preconcurrency.value ();
6432
+
6433
+ element
6434
+ ->diagnose (diag::non_concurrent_type_member, type, true ,
6435
+ element->getName (), nominal)
6436
+ .limitBehaviorWithPreconcurrency (behavior,
6437
+ preconcurrency.has_value ());
6432
6438
return false ;
6433
6439
});
6434
6440
0 commit comments