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
// expected-error@+2{{calls to '@MainActor'-isolated' code in global function 'testP(x:p:)'}}
16
-
// expected-note@+1{{add '@MainActor' to make global function 'testP(x:p:)' part of global actor 'MainActor'}}
17
-
func testP(x:S_P, p:P){
27
+
// expected-note@+1{{add '@MainActor' to make global function 'testP(s:p:)' part of global actor 'MainActor'}}
28
+
func testP(s:S, p:P){ // expected-error {{calls to '@MainActor'-isolated' code in global function 'testP(s:p:)'}}
18
29
p.f() // expected-note{{call to main actor-isolated instance method 'f()' in a synchronous nonisolated context}}
19
30
p.f() // expected-note{{call to main actor-isolated instance method 'f()' in a synchronous nonisolated context}}
20
31
p.f() // expected-note{{call to main actor-isolated instance method 'f()' in a synchronous nonisolated context}}
21
32
p.g() // OKAY
22
-
x.f() // expected-note{{call to main actor-isolated instance method 'f()' in a synchronous nonisolated context}}
23
-
x.f() // expected-note{{call to main actor-isolated instance method 'f()' in a synchronous nonisolated context}}
24
-
x.f() // expected-note{{call to main actor-isolated instance method 'f()' in a synchronous nonisolated context}}
25
-
x.g() // OKAY
33
+
s.f() // expected-note{{call to main actor-isolated instance method 'f()' in a synchronous nonisolated context}}
34
+
s.f() // expected-note{{call to main actor-isolated instance method 'f()' in a synchronous nonisolated context}}
35
+
s.f() // expected-note{{call to main actor-isolated instance method 'f()' in a synchronous nonisolated context}}
36
+
s.g() // OKAY
37
+
}
38
+
// expected-note @+1{{add '@MainActor' to make global function 'testPreconcurrency(ncs:s:)' part of global actor 'MainActor'}}
39
+
func testPreconcurrency(ncs:NonConcurrentS, s:S){ // expected-error {{calls to '@MainActor'-isolated' code in global function 'testPreconcurrency(ncs:s:)'}}
40
+
ncs.f() // expected-note{{call to main actor-isolated instance method 'f()' in a synchronous nonisolated context}}
41
+
ncs.f() // expected-note{{call to main actor-isolated instance method 'f()' in a synchronous nonisolated context}}
42
+
ncs.f() // expected-note{{call to main actor-isolated instance method 'f()' in a synchronous nonisolated context}}
43
+
ncs.g() // OKAY
44
+
s.f() // expected-note{{call to main actor-isolated instance method 'f()' in a synchronous nonisolated context}}
45
+
s.f() // expected-note{{call to main actor-isolated instance method 'f()' in a synchronous nonisolated context}}
46
+
s.f() // expected-note{{call to main actor-isolated instance method 'f()' in a synchronous nonisolated context}}
47
+
s.g() // OKAY
48
+
}
49
+
50
+
// expected-note @+1{{add '@MainActor' to make global function 'testOnlyPreconcurrency(ncs:)' part of global actor 'MainActor'}}
51
+
func testOnlyPreconcurrency(ncs:NonConcurrentS){ // expected-warning {{calls to '@MainActor'-isolated' code in global function 'testOnlyPreconcurrency(ncs:)'}}
52
+
ncs.f() // expected-note{{call to main actor-isolated instance method 'f()' in a synchronous nonisolated context}}
53
+
ncs.f() // expected-note{{call to main actor-isolated instance method 'f()' in a synchronous nonisolated context}}
54
+
ncs.f() // expected-note{{call to main actor-isolated instance method 'f()' in a synchronous nonisolated context}}
0 commit comments