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
@@ -374,13 +374,22 @@ actor WrapperActorBad2<Wrapped> {
374
374
}
375
375
}
376
376
377
+
@propertyWrapper
378
+
structWrapperWithMainActorDefaultInit{
379
+
varwrappedValue:Int{fatalError()}
380
+
381
+
@MainActorinit(){} // expected-note {{calls to initializer 'init()' from outside of its actor context are implicitly asynchronous}}
382
+
}
383
+
377
384
actorActorWithWrapper{
378
385
@WrapperOnActorvarsynced:Int=0
379
386
// expected-note@-1 3{{property declared here}}
380
387
func f(){
381
388
_ = synced // expected-error{{'synced' isolated to global actor}}
382
389
_ = $synced // expected-error{{'$synced' isolated to global actor}}
383
390
_ = _synced // expected-error{{'_synced' isolated to global actor}}
391
+
392
+
@WrapperWithMainActorDefaultInitvarvalue:Int // expected-error {{call to main actor-isolated initializer 'init()' in a synchronous actor-isolated context}}
0 commit comments