mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Introduce checking for ConcurrentValue conformance across actors.
When referring to an actor-isolated declaration from outside of the actor, ensure that the types involved conform to the `ConcurrentValue` protocol. Otherwise, produce a diagnostic stating that it is unsafe to pass such types across actors. Apply the same rule to local captures within concurrent code.
This commit is contained in:
@@ -1168,7 +1168,8 @@ public:
|
||||
DeclAttribute::canAttributeAppearOnDeclKind(DeclAttrKind::DAK_Available,
|
||||
D->getDeclKind()) &&
|
||||
!D->getIntroducingVersion().hasOSAvailability() &&
|
||||
!D->hasDeclAttribute(DeclAttrKind::DAK_AlwaysEmitIntoClient)) {
|
||||
!D->hasDeclAttribute(DeclAttrKind::DAK_AlwaysEmitIntoClient) &&
|
||||
!D->hasDeclAttribute(DeclAttrKind::DAK_Marker)) {
|
||||
D->emitDiag(D->getLoc(), diag::new_decl_without_intro);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user