File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -1072,7 +1072,7 @@ namespace {
1072
1072
1073
1073
bool shouldWalkCaptureInitializerExpressions () override { return true ; }
1074
1074
1075
- bool shouldWalkIntoTapExpression () override { return false ; }
1075
+ bool shouldWalkIntoTapExpression () override { return true ; }
1076
1076
1077
1077
bool walkToDeclPre (Decl *decl) override {
1078
1078
if (auto func = dyn_cast<AbstractFunctionDecl>(decl)) {
Original file line number Diff line number Diff line change @@ -295,6 +295,14 @@ extension GenericStruct where T == String {
295
295
}
296
296
}
297
297
298
+ @SomeGlobalActor
299
+ var number : Int = 42 // expected-note 2 {{mutable state is only available within the actor instance}}
300
+
301
+ //expected-note@+1{{add '@SomeGlobalActor' to make global function 'badNumberUser()' part of global actor 'SomeGlobalActor'}}
302
+ func badNumberUser( ) {
303
+ //expected-error@+1{{var 'number' isolated to global actor 'SomeGlobalActor' can not be referenced from this context}}
304
+ print ( " The protected number is: \( number) " )
305
+ }
298
306
299
307
// ----------------------------------------------------------------------
300
308
// Non-actor code isolation restrictions
@@ -336,6 +344,9 @@ func testGlobalRestrictions(actor: MyActor) async {
336
344
acceptConcurrentClosure { [ i] in
337
345
_ = i
338
346
}
347
+
348
+ //expected-error@+1{{var 'number' isolated to global actor 'SomeGlobalActor' can not be referenced from this context}}
349
+ print ( " \( number) " )
339
350
}
340
351
341
352
func f( ) {
You can’t perform that action at this time.
0 commit comments