Skip to content

Commit 9f0b2ec

Browse files
committed
[Concurrency] Minor wording change to witness and override Sendable diagnostics.
1 parent bd1653e commit 9f0b2ec

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5644,12 +5644,12 @@ ERROR(non_sendable_arg_exits_actor,none,
56445644
"%kind1",
56455645
(Type, const ValueDecl *, ActorIsolation))
56465646
ERROR(non_sendable_param_in_witness,none,
5647-
"non-sendable parameter type %0 cannot be sent from protocol "
5648-
"requirement %1 into %2 implementation",
5647+
"non-sendable parameter type %0 cannot be sent from caller of "
5648+
"protocol requirement %1 into %2 implementation",
56495649
(Type, const ValueDecl *, ActorIsolation))
56505650
ERROR(non_sendable_param_in_override,none,
5651-
"non-sendable parameter type %0 cannot be sent from superclass "
5652-
"%kind1 into %2 override",
5651+
"non-sendable parameter type %0 cannot be sent from caller of "
5652+
"superclass %kind1 into %2 override",
56535653
(Type, const ValueDecl *, ActorIsolation))
56545654
ERROR(non_sendable_param_in_objc,none,
56555655
"non-sendable parameter type %0 of %2 '@objc' %kind1 cannot cross actor "

test/Concurrency/concurrent_value_checking.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ protocol AsyncProto {
270270
}
271271

272272
extension A1: AsyncProto {
273-
func asyncMethod(_: NotConcurrent) async { } // expected-warning{{non-sendable parameter type 'NotConcurrent' cannot be sent from protocol requirement 'asyncMethod' into actor-isolated implementation}}
273+
func asyncMethod(_: NotConcurrent) async { } // expected-warning{{non-sendable parameter type 'NotConcurrent' cannot be sent from caller of protocol requirement 'asyncMethod' into actor-isolated implementation}}
274274
}
275275

276276
protocol MainActorProto {
@@ -279,7 +279,7 @@ protocol MainActorProto {
279279

280280
class SomeClass: MainActorProto {
281281
@SomeGlobalActor
282-
func asyncMainMethod(_: NotConcurrent) async { } // expected-warning{{non-sendable parameter type 'NotConcurrent' cannot be sent from protocol requirement 'asyncMainMethod' into global actor 'SomeGlobalActor'-isolated implementation}}
282+
func asyncMainMethod(_: NotConcurrent) async { } // expected-warning{{non-sendable parameter type 'NotConcurrent' cannot be sent from caller of protocol requirement 'asyncMainMethod' into global actor 'SomeGlobalActor'-isolated implementation}}
283283
}
284284

285285
// ----------------------------------------------------------------------

test/Concurrency/sendable_checking.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@ protocol P {
142142
func foo(x : () -> ()) -> () {}
143143

144144
func bar(x : () -> ()) -> () {}
145-
// expected-warning@-1 {{non-sendable parameter type '() -> ()' cannot be sent from protocol requirement 'bar(x:)' into actor-isolated implementation}}
145+
// expected-warning@-1 {{non-sendable parameter type '() -> ()' cannot be sent from caller of protocol requirement 'bar(x:)' into actor-isolated implementation}}
146146

147147
func foo2<T>(x : T) -> () {}
148148

149149
func bar2<T>(x : T) -> () {}
150-
// expected-warning@-1 {{non-sendable parameter type 'T' cannot be sent from protocol requirement 'bar2(x:)' into actor-isolated implementation}}
150+
// expected-warning@-1 {{non-sendable parameter type 'T' cannot be sent from caller of protocol requirement 'bar2(x:)' into actor-isolated implementation}}
151151
}
152152

153153
@available(SwiftStdlib 5.1, *)
@@ -174,12 +174,12 @@ class Sub : Super {
174174
override nonisolated func foo(x : () -> ()) async {}
175175

176176
override nonisolated func bar(x : () -> ()) async {}
177-
// expected-warning@-1 {{non-sendable parameter type '() -> ()' cannot be sent from superclass instance method 'bar(x:)' into nonisolated override}}
177+
// expected-warning@-1 {{non-sendable parameter type '() -> ()' cannot be sent from caller of superclass instance method 'bar(x:)' into nonisolated override}}
178178

179179
override nonisolated func foo2<T>(x: T) async {}
180180

181181
override nonisolated func bar2<T>(x: T) async {}
182-
// expected-warning@-1 {{non-sendable parameter type 'T' cannot be sent from superclass instance method 'bar2(x:)' into nonisolated override}}
182+
// expected-warning@-1 {{non-sendable parameter type 'T' cannot be sent from caller of superclass instance method 'bar2(x:)' into nonisolated override}}
183183
}
184184

185185
@available(SwiftStdlib 5.1, *)
@@ -216,8 +216,8 @@ class SuperWUnsafeSubscript {
216216
class SubWUnsafeSubscript : SuperWUnsafeSubscript {
217217
override nonisolated subscript<T>(x : T) -> Int {
218218
get async {
219-
// expected-warning@-2{{non-sendable parameter type 'T' cannot be sent from superclass subscript 'subscript(_:)' into nonisolated override}}
220-
// expected-warning@-2{{non-sendable parameter type 'T' cannot be sent from superclass getter for subscript 'subscript(_:)' into nonisolated override}}
219+
// expected-warning@-2{{non-sendable parameter type 'T' cannot be sent from caller of superclass subscript 'subscript(_:)' into nonisolated override}}
220+
// expected-warning@-2{{non-sendable parameter type 'T' cannot be sent from caller of superclass getter for subscript 'subscript(_:)' into nonisolated override}}
221221
// there really shouldn't be two warnings produced here, see rdar://110846040 (Sendable diagnostics reported twice for subscript getters)
222222
return 0
223223
}

test/Concurrency/sendable_override_checking.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ class Super {
2424
@available(SwiftStdlib 5.1, *)
2525
class Sub: Super {
2626
@MainActor override func f(_: NotSendable) async { }
27-
// expected-warning@-1{{non-sendable parameter type 'NotSendable' cannot be sent from superclass instance method 'f' into main actor-isolated override}}
27+
// expected-warning@-1{{non-sendable parameter type 'NotSendable' cannot be sent from caller of superclass instance method 'f' into main actor-isolated override}}
2828

2929
nonisolated override func g1(_: NotSendable) { } // okay, synchronous
3030

3131
nonisolated override func g2(_: NotSendable) async { }
32-
// expected-warning@-1{{non-sendable parameter type 'NotSendable' cannot be sent from superclass instance method 'g2' into nonisolated override}}
32+
// expected-warning@-1{{non-sendable parameter type 'NotSendable' cannot be sent from caller of superclass instance method 'g2' into nonisolated override}}
3333
}

0 commit comments

Comments
 (0)