File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed
Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -1141,8 +1141,11 @@ namespace {
11411141 return true ;
11421142 }
11431143
1144- case ActorIsolation::Independent:
11451144 case ActorIsolation::IndependentUnsafe:
1145+ // Allow unrestricted use of something in a global actor.
1146+ return false ;
1147+
1148+ case ActorIsolation::Independent:
11461149 if (inspectForImplicitlyAsync ())
11471150 return false ;
11481151
@@ -1168,8 +1171,8 @@ namespace {
11681171 }
11691172 noteIsolatedActorMember (value);
11701173 };
1171-
1172- if (AbstractFunctionDecl const * fn =
1174+
1175+ if (AbstractFunctionDecl const * fn =
11731176 dyn_cast_or_null<AbstractFunctionDecl>(declContext->getAsDecl ())) {
11741177 bool isAsyncContext = fn->isAsyncContext ();
11751178
Original file line number Diff line number Diff line change @@ -211,3 +211,21 @@ actor class Actor4 {
211211 set { time = newValue }
212212 }
213213}
214+
215+ actor class SomeActor { }
216+
217+ @globalActor
218+ struct SomeGlobalActor {
219+ static let shared = SomeActor ( )
220+ }
221+
222+ @SomeGlobalActor
223+ class NormalClass {
224+ var bar : String = " "
225+
226+ @actorIndependent ( unsafe)
227+ var unsafeBar : String { bar }
228+
229+ @actorIndependent ( unsafe)
230+ func getUnsafeBar( ) -> String { bar }
231+ }
You can’t perform that action at this time.
0 commit comments