Skip to content

Commit b8cf5ae

Browse files
committed
Updates for 6.2.
These were changes that were not updated in the previous commit due to merge conflict resolution or that the test itself was not in 6.2.
1 parent 0d519a1 commit b8cf5ae

File tree

7 files changed

+16
-16
lines changed

7 files changed

+16
-16
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5960,7 +5960,7 @@ ERROR(nonisolated_lazy,none,
59605960
())
59615961

59625962
ERROR(non_sendable_from_deinit,none,
5963-
"cannot access %1 %2 with a non-sendable type %0 from nonisolated deinit",
5963+
"cannot access %1 %2 with a non-Sendable type %0 from nonisolated deinit",
59645964
(Type, DescriptiveDeclKind, DeclName))
59655965

59665966
ERROR(actor_instance_property_wrapper,none,

test/Concurrency/actor_call_implicitly_async.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func someAsyncFunc() async {
176176
////////////
177177
// effectful properties from outside the actor instance
178178

179-
// expected-warning@+2 {{non-sendable type 'Box' of property 'effPropA' cannot exit actor-isolated context}}
179+
// expected-warning@+2 {{non-Sendable type 'Box' of property 'effPropA' cannot exit actor-isolated context}}
180180
// expected-error@+1{{actor-isolated property 'effPropA' cannot be accessed from outside of the actor}} {{7-7=await }}
181181
_ = a.effPropA
182182

test/Concurrency/actor_isolation.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func checkAsyncPropertyAccess() async {
116116
act.text[0] += "hello" // expected-error{{actor-isolated property 'text' can not be mutated from a nonisolated context}}
117117
// expected-note@-1{{consider declaring an isolated method on 'MyActor' to perform the mutation}}
118118

119-
_ = act.point // expected-warning{{non-sendable type 'Point' of property 'point' cannot exit actor-isolated context}}
119+
_ = act.point // expected-warning{{non-Sendable type 'Point' of property 'point' cannot exit actor-isolated context}}
120120
// expected-warning@-1 {{actor-isolated property 'point' cannot be accessed from outside of the actor}} {{7-7=await }}
121121
}
122122

@@ -1054,8 +1054,8 @@ func testCrossModuleLets(actor: OtherModuleActor) async {
10541054
_ = await actor.a // okay
10551055
_ = actor.b // okay
10561056
_ = actor.c // expected-error{{actor-isolated property 'c' cannot be accessed from outside of the actor}} {{7-7=await }}
1057-
// expected-warning@-1{{non-sendable type 'SomeClass' of property 'c' cannot exit actor-isolated context}}
1058-
_ = await actor.c // expected-warning{{non-sendable type 'SomeClass' of property 'c' cannot exit actor-isolated context}}
1057+
// expected-warning@-1{{non-Sendable type 'SomeClass' of property 'c' cannot exit actor-isolated context}}
1058+
_ = await actor.c // expected-warning{{non-Sendable type 'SomeClass' of property 'c' cannot exit actor-isolated context}}
10591059
_ = await actor.d // okay
10601060
}
10611061

@@ -1088,8 +1088,8 @@ actor CrossModuleFromInitsActor {
10881088
_ = await actor.a // okay
10891089
_ = actor.b // okay
10901090
_ = actor.c // expected-error{{actor-isolated property 'c' cannot be accessed from outside of the actor}} {{9-9=await }}
1091-
// expected-warning@-1{{non-sendable type 'SomeClass' of property 'c' cannot exit actor-isolated context}}
1092-
_ = await actor.c // expected-warning{{non-sendable type 'SomeClass' of property 'c' cannot exit actor-isolated context}}
1091+
// expected-warning@-1{{non-Sendable type 'SomeClass' of property 'c' cannot exit actor-isolated context}}
1092+
_ = await actor.c // expected-warning{{non-Sendable type 'SomeClass' of property 'c' cannot exit actor-isolated context}}
10931093
_ = await actor.d // okay
10941094
}
10951095
}
@@ -1636,7 +1636,7 @@ class ReferenceActor {
16361636
init() async {
16371637
self.a = ProtectNonSendable()
16381638

1639-
// expected-warning@+2 {{non-sendable type 'NonSendable' of property 'ns' cannot exit actor-isolated context}}
1639+
// expected-warning@+2 {{non-Sendable type 'NonSendable' of property 'ns' cannot exit actor-isolated context}}
16401640
// expected-warning@+1 {{actor-isolated property 'ns' cannot be accessed from outside of the actor}} {{9-9=await }}
16411641
_ = a.ns
16421642
}

test/Concurrency/concurrent_value_checking.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ extension A1 {
9999
_ = await self.asynchronous(nil)
100100

101101
// Across to a different actor, so Sendable restriction is enforced.
102-
_ = other.localLet // expected-warning{{non-sendable type 'NotConcurrent' of property 'localLet' cannot exit actor-isolated context}}
102+
_ = other.localLet // expected-warning{{non-Sendable type 'NotConcurrent' of property 'localLet' cannot exit actor-isolated context}}
103103
// expected-warning@-1 {{actor-isolated property 'localLet' cannot be accessed from outside of the actor}} {{9-9=await }}
104104
_ = await other.synchronous() // expected-tns-warning {{non-Sendable 'NotConcurrent?'-typed result can not be returned from actor-isolated instance method 'synchronous()' to actor-isolated context}}
105105
_ = await other.asynchronous(nil)
@@ -138,13 +138,13 @@ enum E {
138138

139139
func globalTest() async {
140140
// expected-warning@+1 {{global actor 'SomeGlobalActor'-isolated let 'globalValue' cannot be accessed from outside of the actor}} {{11-11=await }}
141-
let a = globalValue // expected-warning{{non-sendable type 'NotConcurrent?' of let 'globalValue' cannot exit global actor 'SomeGlobalActor'-isolated context}}
141+
let a = globalValue // expected-warning{{non-Sendable type 'NotConcurrent?' of let 'globalValue' cannot exit global actor 'SomeGlobalActor'-isolated context}}
142142
await globalAsync(a) // expected-tns-warning {{sending 'a' risks causing data races}}
143143
// expected-tns-note @-1 {{sending global actor 'SomeGlobalActor'-isolated 'a' to global actor 'SomeGlobalActor'-isolated global function 'globalAsync' risks causing data races between global actor 'SomeGlobalActor'-isolated and local nonisolated uses}}
144144
await globalSync(a) // expected-tns-note {{access can happen concurrently}}
145145

146146
// expected-warning@+1 {{global actor 'SomeGlobalActor'-isolated static property 'notSafe' cannot be accessed from outside of the actor}} {{11-11=await }}
147-
let _ = E.notSafe // expected-warning{{non-sendable type 'NotConcurrent?' of static property 'notSafe' cannot exit global actor 'SomeGlobalActor'-isolated context}}
147+
let _ = E.notSafe // expected-warning{{non-Sendable type 'NotConcurrent?' of static property 'notSafe' cannot exit global actor 'SomeGlobalActor'-isolated context}}
148148

149149
#if ALLOW_TYPECHECKER_ERRORS
150150
// expected-typechecker-error@+3 {{expression is 'async' but is not marked with 'await'}}
@@ -173,7 +173,7 @@ class ClassWithGlobalActorInits { // expected-tns-note 2{{class 'ClassWithGlobal
173173
@MainActor
174174
func globalTestMain(nc: NotConcurrent) async {
175175
// expected-warning@+1 {{global actor 'SomeGlobalActor'-isolated let 'globalValue' cannot be accessed from outside of the actor}} {{11-11=await }}
176-
let a = globalValue // expected-warning {{non-sendable type 'NotConcurrent?' of let 'globalValue' cannot exit global actor 'SomeGlobalActor'-isolated context}}
176+
let a = globalValue // expected-warning {{non-Sendable type 'NotConcurrent?' of let 'globalValue' cannot exit global actor 'SomeGlobalActor'-isolated context}}
177177
await globalAsync(a) // expected-tns-warning {{sending 'a' risks causing data races}}
178178
// expected-tns-note @-1 {{sending global actor 'SomeGlobalActor'-isolated 'a' to global actor 'SomeGlobalActor'-isolated global function 'globalAsync' risks causing data races between global actor 'SomeGlobalActor'-isolated and local main actor-isolated uses}}
179179
await globalSync(a) // expected-tns-note {{access can happen concurrently}}

test/Concurrency/isolated_parameters.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ nonisolated func callFromNonisolated(ns: NotSendable) async {
445445
#if ALLOW_TYPECHECKER_ERRORS
446446
optionalIsolatedSync(ns, to: myActor)
447447
// expected-typechecker-error@-1 {{actor-isolated global function 'optionalIsolatedSync(_:to:)' cannot be called from outside of the actor}} {{3-3=await }}
448-
// expected-complete-warning@-2 {{passing argument of non-sendable type 'NotSendable' into actor-isolated context may introduce data races}}
448+
// expected-complete-warning@-2 {{passing argument of non-Sendable type 'NotSendable' into actor-isolated context may introduce data races}}
449449
#endif
450450
}
451451
@@ -467,7 +467,7 @@ nonisolated func callFromNonisolated(ns: NotSendable) async {
467467
#if ALLOW_TYPECHECKER_ERRORS
468468
optionalIsolatedSync(ns, to: myActor)
469469
// expected-typechecker-error@-1 {{actor-isolated global function 'optionalIsolatedSync(_:to:)' cannot be called from outside of the actor}} {{3-3=await }}
470-
// expected-complete-warning@-2 {{passing argument of non-sendable type 'NotSendable' into actor-isolated context may introduce data races}}
470+
// expected-complete-warning@-2 {{passing argument of non-Sendable type 'NotSendable' into actor-isolated context may introduce data races}}
471471
#endif
472472
}
473473

test/Concurrency/sendable_checking.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ struct DowngradeForPreconcurrency {
460460
AsyncStream<NonSendable> {
461461
self.x
462462
// expected-warning@-1 {{main actor-isolated property 'x' cannot be accessed from outside of the actor; this is an error in the Swift 6 language mode}} {{7-7=await }}
463-
// expected-warning@-2 {{non-sendable type 'NonSendable' of property 'x' cannot exit main actor-isolated context; this is an error in the Swift 6 language mode}}
463+
// expected-warning@-2 {{non-Sendable type 'NonSendable' of property 'x' cannot exit main actor-isolated context; this is an error in the Swift 6 language mode}}
464464
}
465465
}
466466
}

validation-test/Sema/SwiftUI/rdar76252310.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func fromMainActor() async {
4141
func fromConcurrencyAware() async {
4242
let view = CoffeeTrackerView() // synthesized 'init' is 'nonisolated'
4343

44-
// expected-warning@+2 {{non-sendable type 'some View' of property 'body' cannot exit main actor-isolated context}}
44+
// expected-warning@+2 {{non-Sendable type 'some View' of property 'body' cannot exit main actor-isolated context}}
4545
// expected-warning@+1 {{main actor-isolated property 'body' cannot be accessed from outside of the actor}} {{7-7=await }}
4646
_ = view.body
4747

0 commit comments

Comments
 (0)