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
// If the protocol itself is isolated, don't do anything.
32
+
extensionCExplicitMainActor:Q{
33
+
func g(){}
34
+
}
35
+
36
+
extensionCImplicitMainActor:Q{
37
+
func g(){}
38
+
}
39
+
26
40
// expected-note@+2{{add '@preconcurrency' to the 'P' conformance to defer isolation checking to run time}}
27
41
// expected-note@+1{{add '@MainActor' to the 'P' conformance to restrict it to main actor-isolated code}}
28
42
nonisolatedclassCNonIsolated:P{
29
43
@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
51
let _:anyP=CImplicitMainActor() // expected-error{{main actor-isolated conformance of 'CImplicitMainActor' to 'P' cannot be used in nonisolated context}}
37
52
38
53
let _:anyP=CNonIsolated()
39
54
let _:anyP=CImplicitMainActorNonisolatedConformance()
0 commit comments