Skip to content

Commit 42c0658

Browse files
committed
Improve diagnostic wording
1 parent 3d91fd1 commit 42c0658

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1940,7 +1940,7 @@ NOTE(nonsendable_tuple_type,none,
19401940
"a tuple type must be composed of 'Sendable' elements to conform to "
19411941
"'Sendable'", ())
19421942
NOTE(add_nominal_sendable_conformance,none,
1943-
"add conformance of %0 %1 to the 'Sendable' protocol",
1943+
"consider making %0 %1 conform to the 'Sendable' protocol",
19441944
(DescriptiveDeclKind, DeclName))
19451945

19461946
NOTE(required_by_opaque_return,none,

test/Concurrency/concurrent_value_inference.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ struct S1 {
1010
var c: C2
1111
}
1212

13-
enum E1 { // expected-note{{add conformance of enum 'E1' to the 'Sendable' protocol}}
13+
enum E1 { // expected-note{{consider making enum 'E1' conform to the 'Sendable' protocol}}{{9-9=: Sendable }}
1414
case base
1515
indirect case nested(E1)
1616
}
@@ -22,7 +22,7 @@ enum E2 {
2222

2323
struct GS1<T> { }
2424

25-
struct GS2<T> { // expected-note{{add conformance of generic struct 'GS2' to the 'Sendable' protocol}}
25+
struct GS2<T> { // expected-note{{consider making generic struct 'GS2' conform to the 'Sendable' protocol}}
2626
var storage: T
2727
}
2828

@@ -33,7 +33,7 @@ struct Signature { }
3333
struct Data { }
3434
struct BlockInfo { }
3535

36-
struct Bitcode { // expected-note{{add conformance of struct 'Bitcode' to the 'Sendable' protocol}}
36+
struct Bitcode { // expected-note{{consider making struct 'Bitcode' conform to the 'Sendable' protocol}}
3737
let signature: Signature
3838
let elements: [BitcodeElement]
3939
let blockInfo: [UInt64: BlockInfo]
@@ -64,11 +64,11 @@ enum BitcodeElement {
6464

6565
// Public structs and enums do not get implicit Sendable unless they
6666
// are frozen.
67-
public struct PublicStruct { // expected-note{{add conformance of struct 'PublicStruct' to the 'Sendable' protocol}}
67+
public struct PublicStruct { // expected-note{{consider making struct 'PublicStruct' conform to the 'Sendable' protocol}}
6868
var i: Int
6969
}
7070

71-
public enum PublicEnum { // expected-note{{add conformance of enum 'PublicEnum' to the 'Sendable' protocol}}
71+
public enum PublicEnum { // expected-note{{consider making enum 'PublicEnum' conform to the 'Sendable' protocol}}
7272
case some
7373
}
7474

0 commit comments

Comments
 (0)