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
structTest1:TestProtocol{ // expected-warning{{type 'Test1.Value' (aka 'C1') does not conform to the 'Sendable' protocol}}
18
+
structTest1:TestProtocol{ // expected-error{{type 'Test1.Value' (aka 'C1') does not conform to the 'Sendable' protocol}}
19
19
typealiasValue=C1
20
20
}
21
21
22
-
structTest2:TestProtocol{ // expected-warning{{conformance of 'C2' to 'Sendable' is unavailable}}
22
+
structTest2:TestProtocol{ // expected-error{{conformance of 'C2' to 'Sendable' is unavailable}}
23
23
// expected-note@-1{{in associated type 'Self.Value' (inferred as 'C2')}}
24
24
typealiasValue=C2
25
25
}
@@ -32,7 +32,7 @@ actor TestGlobalActor {
32
32
@TestGlobalActor
33
33
varmutableIsolatedGlobal=1
34
34
35
-
varmutableNonisolatedGlobal=1 // expected-warning{{var 'mutableNonisolatedGlobal' is not concurrency-safe because it is non-isolated global shared mutable state}}
35
+
varmutableNonisolatedGlobal=1 // expected-error{{var 'mutableNonisolatedGlobal' is not concurrency-safe because it is non-isolated global shared mutable state}}
36
36
// expected-note@-1{{isolate 'mutableNonisolatedGlobal' to a global actor, or convert it to a 'let' constant and conform it to 'Sendable'}}
37
37
38
38
letimmutableGlobal=1
@@ -57,23 +57,23 @@ public struct TestWrapper {
57
57
58
58
structTestStatics{
59
59
staticletimmutableExplicitSendable=TestSendable()
60
-
staticletimmutableNonsendable=TestNonsendable() // expected-warning{{static property 'immutableNonsendable' is not concurrency-safe because it is not either conforming to 'Sendable' or isolated to a global actor}}
60
+
staticletimmutableNonsendable=TestNonsendable() // expected-error{{static property 'immutableNonsendable' is not concurrency-safe because it is not either conforming to 'Sendable' or isolated to a global actor}}
staticnonisolatedletimmutableNonisolated=TestNonsendable() // expected-warning{{static property 'immutableNonisolated' is not concurrency-safe because it is not either conforming to 'Sendable' or isolated to a global actor}}
62
+
staticnonisolatedletimmutableNonisolated=TestNonsendable() // expected-error{{static property 'immutableNonisolated' is not concurrency-safe because it is not either conforming to 'Sendable' or isolated to a global actor}}
63
63
staticletimmutableInferredSendable=0
64
-
staticvarmutable=0 // expected-warning{{static property 'mutable' is not concurrency-safe because it is non-isolated global shared mutable state}}
64
+
staticvarmutable=0 // expected-error{{static property 'mutable' is not concurrency-safe because it is non-isolated global shared mutable state}}
65
65
// expected-note@-1{{isolate 'mutable' to a global actor, or convert it to a 'let' constant and conform it to 'Sendable'}}
staticvarcomputedProperty:Int{0} // computed property that, though static, has no storage so is not a global
68
-
@TestWrapperstaticvarwrapped:Int // expected-warning{{static property 'wrapped' is not concurrency-safe because it is non-isolated global shared mutable state}}
68
+
@TestWrapperstaticvarwrapped:Int // expected-error{{static property 'wrapped' is not concurrency-safe because it is non-isolated global shared mutable state}}
69
69
// expected-note@-1{{isolate 'wrapped' to a global actor, or convert it to a 'let' constant and conform it to 'Sendable'}}
70
70
}
71
71
72
72
@TestGlobalActor
73
73
func f(){
74
74
print(TestStatics.immutableExplicitSendable)
75
75
print(TestStatics.immutableInferredSendable)
76
-
print(TestStatics.mutable) // expected-warning{{reference to static property 'mutable' is not concurrency-safe because it involves shared mutable state}}
76
+
print(TestStatics.mutable) // expected-error{{reference to static property 'mutable' is not concurrency-safe because it involves shared mutable state}}
0 commit comments