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
[Isolated conformances] Infer main actor isolation under UnspecifiedMeansMainActorIsolated
When code in the current module defaults to main actor (under SE-0466),
also infer main-actor isolation for protocol conformances of main-actor
isolated types.
// expected-note@+2{{add '@preconcurrency' to the 'P' conformance to defer isolation checking to run time}}
27
+
// expected-note@+1{{add '@MainActor' to the 'P' conformance to restrict it to main actor-isolated code}}
28
+
nonisolatedclassCNonIsolated:P{
29
+
@MainActorfunc f(){} // expected-error{{main actor-isolated instance method 'f()' cannot be used to satisfy nonisolated requirement from protocol 'P'}}
let _:anyP=CExplicitMainActor() // expected-error{{main actor-isolated conformance of 'CExplicitMainActor' to 'P' cannot be used in nonisolated context}}
36
+
let _:anyP=CImplicitMainActor() // expected-error{{main actor-isolated conformance of 'CImplicitMainActor' to 'P' cannot be used in nonisolated context}}
37
+
38
+
let _:anyP=CNonIsolated()
39
+
let _:anyP=CImplicitMainActorNonisolatedConformance()
0 commit comments