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
s.f() // expected-note{{call to main actor-isolated instance method 'f()' in a synchronous nonisolated context}}
30
36
s.g() // OKAY
31
37
}
32
-
// expected-note @+1{{add '@MainActor' to make global function 'testPreconcurrencyP(ncs:)' part of global actor 'MainActor'}}
33
-
func testPreconcurrencyP(ncs:NonConcurrentS){ // expected-error {{calls to '@MainActor'-isolated' code in global function 'testPreconcurrencyP(ncs:)'}}
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:)'}}
34
52
ncs.f() // expected-note{{call to main actor-isolated instance method 'f()' in a synchronous nonisolated context}}
35
53
ncs.f() // expected-note{{call to main actor-isolated instance method 'f()' in a synchronous nonisolated context}}
36
54
ncs.f() // expected-note{{call to main actor-isolated instance method 'f()' in a synchronous nonisolated context}}
0 commit comments