You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/Concurrency/global_actor_inference.swift
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -361,13 +361,22 @@ actor WrapperActorBad2<Wrapped> {
361
361
}
362
362
}
363
363
364
+
@propertyWrapper
365
+
structWrapperWithMainActorDefaultInit{
366
+
varwrappedValue:Int{fatalError()}
367
+
368
+
@MainActorinit(){} // expected-note {{calls to initializer 'init()' from outside of its actor context are implicitly asynchronous}}
369
+
}
370
+
364
371
actorActorWithWrapper{
365
372
@WrapperOnActorvarsynced:Int=0
366
373
// expected-note@-1 3{{property declared here}}
367
374
func f(){
368
375
_ = synced // expected-error{{'synced' isolated to global actor}}
369
376
_ = $synced // expected-error{{'$synced' isolated to global actor}}
370
377
_ = _synced // expected-error{{'_synced' isolated to global actor}}
378
+
379
+
@WrapperWithMainActorDefaultInitvarvalue:Int // expected-error {{call to main actor-isolated initializer 'init()' in a synchronous actor-isolated context}}
0 commit comments