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 {
1141
1141
return true ;
1142
1142
}
1143
1143
1144
- case ActorIsolation::Independent:
1145
1144
case ActorIsolation::IndependentUnsafe:
1145
+ // Allow unrestricted use of something in a global actor.
1146
+ return false ;
1147
+
1148
+ case ActorIsolation::Independent:
1146
1149
if (inspectForImplicitlyAsync ())
1147
1150
return false ;
1148
1151
@@ -1168,8 +1171,8 @@ namespace {
1168
1171
}
1169
1172
noteIsolatedActorMember (value);
1170
1173
};
1171
-
1172
- if (AbstractFunctionDecl const * fn =
1174
+
1175
+ if (AbstractFunctionDecl const * fn =
1173
1176
dyn_cast_or_null<AbstractFunctionDecl>(declContext->getAsDecl ())) {
1174
1177
bool isAsyncContext = fn->isAsyncContext ();
1175
1178
Original file line number Diff line number Diff line change @@ -211,3 +211,21 @@ actor class Actor4 {
211
211
set { time = newValue }
212
212
}
213
213
}
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