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
act.text[0]+="hello" // expected-error{{actor-isolated property 'text' can not be mutated from a non-isolated context}}
116
116
117
-
_ = act.point // expected-warning{{non-sendable type 'Point' in asynchronous access to actor-isolated property 'point' cannot cross actor boundary}}
117
+
_ = act.point // expected-warning{{non-sendable type 'Point' in implicitly asynchronous access to actor-isolated property 'point' cannot cross actor boundary}}
118
+
// expected-warning@-1 {{expression is 'async' but is not marked with 'await'}}
119
+
// expected-note@-2 {{property access is 'async'}}
@@ -1538,11 +1540,11 @@ class OverridesNonsiolatedInit: SuperWithNonisolatedInit {
1538
1540
}
1539
1541
}
1540
1542
1541
-
// expected-note@+1 2 {{class 'NonSendable' does not conform to the 'Sendable' protocol}}
1543
+
// expected-note@+1 {{class 'NonSendable' does not conform to the 'Sendable' protocol}}
1542
1544
classNonSendable{}
1543
1545
1544
1546
actorProtectNonSendable{
1545
-
// expected-note@+1 {{property declared here}}
1547
+
// expected-note@+1 2 {{property declared here}}
1546
1548
letns=NonSendable()
1547
1549
1548
1550
init(){}
@@ -1560,7 +1562,9 @@ class ReferenceActor {
1560
1562
init()async{
1561
1563
self.a =ProtectNonSendable()
1562
1564
1563
-
// expected-warning@+1 {{non-sendable type 'NonSendable' in asynchronous access to actor-isolated property 'ns' cannot cross actor boundary}}
1565
+
// expected-warning@+3 {{non-sendable type 'NonSendable' in implicitly asynchronous access to actor-isolated property 'ns' cannot cross actor boundary}}
1566
+
// expected-warning@+2 {{expression is 'async' but is not marked with 'await'}}
1567
+
// expected-note@+1 {{property access is 'async'}}
1564
1568
_ = a.ns
1565
1569
}
1566
1570
}
@@ -1571,7 +1575,7 @@ actor AnotherActor {
1571
1575
init(){
1572
1576
self.a =ProtectNonSendable()
1573
1577
1574
-
// expected-warning@+1 {{non-sendable type 'NonSendable' in asynchronous access to actor-isolated property 'ns' cannot cross actor boundary}}
1578
+
// expected-warning@+1 {{actor-isolated property 'ns' can not be referenced from a non-isolated context}}
Copy file name to clipboardExpand all lines: test/Concurrency/concurrent_value_checking.swift
+4-2Lines changed: 4 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -86,7 +86,9 @@ extension A1 {
86
86
_ =awaitself.asynchronous(nil)
87
87
88
88
// Across to a different actor, so Sendable restriction is enforced.
89
-
_ = other.localLet // expected-warning{{non-sendable type 'NotConcurrent' in asynchronous access to actor-isolated property 'localLet' cannot cross actor boundary}}
89
+
_ = other.localLet // expected-warning{{non-sendable type 'NotConcurrent' in implicitly asynchronous access to actor-isolated property 'localLet' cannot cross actor boundary}}
90
+
// expected-warning@-1 {{expression is 'async' but is not marked with 'await'}}
91
+
// expected-note@-2 {{property access is 'async'}}
90
92
_ =await other.synchronous() // expected-warning{{non-sendable type 'NotConcurrent?' returned by call to actor-isolated function cannot cross actor boundary}}
91
93
_ =await other.asynchronous(nil) // expected-complete-warning{{passing argument of non-sendable type 'NotConcurrent?' into actor-isolated context may introduce data races}}
0 commit comments