|
2 | 2 |
|
3 | 3 | public protocol P { } |
4 | 4 |
|
| 5 | +// expected-note@+2{{consider making struct 'S1' conform to the 'Sendable' protocol}}{{18-18=: Sendable}} |
| 6 | +// expected-note@+1{{make struct 'S1' explicitly non-Sendable to suppress this warning}}{{+2:2-2=\n\n@available(*, unavailable)\nextension S1: Sendable { \}\n}} |
5 | 7 | public struct S1 { // expected-warning{{public struct 'S1' does not specify whether it is 'Sendable' or not}} |
6 | | - // expected-note@-1{{consider making struct 'S1' conform to the 'Sendable' protocol}}{{18-18=: Sendable}} |
7 | | - // expected-note@-2{{make struct 'S1' explicitly non-Sendable to suppress this warning}}{{2-2=\n\n@available(*, unavailable)\nextension S1: Sendable { \}\n}} |
8 | 8 | var str: String |
9 | 9 | } |
10 | 10 |
|
11 | 11 | class C { } |
12 | 12 |
|
| 13 | +// expected-note@+2{{add '@unchecked Sendable' conformance to struct 'S2' if this type manually implements concurrency safety}}{{18-18=: @unchecked Sendable}} |
| 14 | +// expected-note@+1{{make struct 'S2' explicitly non-Sendable to suppress this warning}}{{+2:2-2=\n\n@available(*, unavailable)\nextension S2: Sendable { \}\n}} |
13 | 15 | public struct S2 { // expected-warning{{public struct 'S2' does not specify whether it is 'Sendable' or not}} |
14 | | - // expected-note@-1{{add '@unchecked Sendable' conformance to struct 'S2' if this type manually implements concurrency safety}}{{18-18=: @unchecked Sendable}} |
15 | | - // expected-note@-2{{make struct 'S2' explicitly non-Sendable to suppress this warning}}{{2-2=\n\n@available(*, unavailable)\nextension S2: Sendable { \}\n}} |
16 | 16 | var c: C |
17 | 17 | } |
18 | 18 |
|
| 19 | +// expected-note@+2{{consider making class 'C1' conform to the 'Sendable' protocol}}{{25-25=, Sendable}} |
| 20 | +// expected-note@+1{{make class 'C1' explicitly non-Sendable to suppress this warning}}{{+2:2-2=\n\n@available(*, unavailable)\nextension C1: Sendable { \}\n}} |
19 | 21 | final public class C1: P { // expected-warning{{public class 'C1' does not specify whether it is 'Sendable' or not}} |
20 | | - // expected-note@-1{{consider making class 'C1' conform to the 'Sendable' protocol}}{{25-25=, Sendable}} |
21 | | - // expected-note@-2{{make class 'C1' explicitly non-Sendable to suppress this warning}}{{2-2=\n\n@available(*, unavailable)\nextension C1: Sendable { \}\n}} |
22 | 22 | let str: String = "" |
23 | 23 | } |
24 | 24 |
|
| 25 | +// expected-note@+2{{add '@unchecked Sendable' conformance to class 'C2' if this type manually implements concurrency safety}}{{17-17=: @unchecked Sendable}} |
| 26 | +// expected-note@+1{{make class 'C2' explicitly non-Sendable to suppress this warning}}{{+2:2-2=\n\n@available(*, unavailable)\nextension C2: Sendable { \}\n}} |
25 | 27 | public class C2 { // expected-warning{{public class 'C2' does not specify whether it is 'Sendable' or not}} |
26 | | - // expected-note@-1{{add '@unchecked Sendable' conformance to class 'C2' if this type manually implements concurrency safety}}{{17-17=: @unchecked Sendable}} |
27 | | - // expected-note@-2{{make class 'C2' explicitly non-Sendable to suppress this warning}}{{2-2=\n\n@available(*, unavailable)\nextension C2: Sendable { \}\n}} |
28 | 28 | var str: String = "" |
29 | 29 | } |
30 | 30 |
|
| 31 | +// expected-note@+2{{consider making generic struct 'S3' conform to the 'Sendable' protocol}}{{+2:2-2=\n\nextension S3: Sendable where T: Sendable { \}\n}} |
| 32 | +// expected-note@+1{{make generic struct 'S3' explicitly non-Sendable to suppress this warning}}{{+2:2-2=\n\n@available(*, unavailable)\nextension S3: Sendable { \}\n}} |
31 | 33 | public struct S3<T> { // expected-warning{{public generic struct 'S3' does not specify whether it is 'Sendable' or not}} |
32 | | - // expected-note@-1{{consider making generic struct 'S3' conform to the 'Sendable' protocol}}{{2-2=\n\nextension S3: Sendable where T: Sendable { \}\n}} |
33 | | - // expected-note@-2{{make generic struct 'S3' explicitly non-Sendable to suppress this warning}}{{2-2=\n\n@available(*, unavailable)\nextension S3: Sendable { \}\n}} |
34 | 34 | var t: T |
35 | 35 | } |
36 | 36 |
|
| 37 | +// expected-note@+2{{add '@unchecked Sendable' conformance to generic struct 'S4' if this type manually implements concurrency safety}}{{+3:2-2=\n\nextension S4: @unchecked Sendable where T: Sendable { \}\n}} |
| 38 | +// expected-note@+1{{make generic struct 'S4' explicitly non-Sendable to suppress this warning}}{{+3:2-2=\n\n@available(*, unavailable)\nextension S4: Sendable { \}\n}} |
37 | 39 | public struct S4<T> { // expected-warning{{public generic struct 'S4' does not specify whether it is 'Sendable' or not}} |
38 | | - // expected-note@-1{{add '@unchecked Sendable' conformance to generic struct 'S4' if this type manually implements concurrency safety}}{{2-2=\n\nextension S4: @unchecked Sendable where T: Sendable { \}\n}} |
39 | | - // expected-note@-2{{make generic struct 'S4' explicitly non-Sendable to suppress this warning}}{{2-2=\n\n@available(*, unavailable)\nextension S4: Sendable { \}\n}} |
40 | 40 | var t: T |
41 | 41 | var c: C |
42 | 42 | } |
@@ -71,20 +71,20 @@ func testMe(s5: S5, s7: S7) { |
71 | 71 | acceptSendable(s7) // expected-warning{{conformance of 'S7' to 'Sendable' is unavailable}} |
72 | 72 | } |
73 | 73 |
|
| 74 | +// expected-note@+2{{consider making generic struct 'S8' conform to the 'Sendable' protocol}}{{+2:2-2=\n\nextension S8: Sendable where T: Sendable, U: Sendable, V: Sendable { \}\n}} |
| 75 | +// expected-note@+1{{make generic struct 'S8' explicitly non-Sendable to suppress this warning}} |
74 | 76 | public struct S8<T: Hashable, U, V> { // expected-warning{{public generic struct 'S8' does not specify whether it is 'Sendable' or not}} |
75 | | - // expected-note@-1{{consider making generic struct 'S8' conform to the 'Sendable' protocol}}{{2-2=\n\nextension S8: Sendable where T: Sendable, U: Sendable, V: Sendable { \}\n}} |
76 | | - // expected-note@-2{{make generic struct 'S8' explicitly non-Sendable to suppress this warning}} |
77 | 77 | var member: [T: (U, V?)] |
78 | 78 | } |
79 | 79 |
|
80 | 80 | public protocol P2 { |
81 | 81 | associatedtype A |
82 | 82 | } |
83 | 83 |
|
| 84 | +// expected-warning@+3{{public generic struct 'S9' does not specify whether it is 'Sendable' or not}} |
| 85 | +// expected-note@+2{{consider making generic struct 'S9' conform to the 'Sendable' protocol}}{{+2:2-2=\n\nextension S9: Sendable where T: Sendable, T.A: Sendable { \}\n}} |
| 86 | +// expected-note@+1{{make generic struct 'S9' explicitly non-Sendable to suppress this warning}} |
84 | 87 | public struct S9<T: P2 & Hashable> { |
85 | | - // expected-warning@-1{{public generic struct 'S9' does not specify whether it is 'Sendable' or not}} |
86 | | - // expected-note@-2{{consider making generic struct 'S9' conform to the 'Sendable' protocol}}{{2-2=\n\nextension S9: Sendable where T: Sendable, T.A: Sendable { \}\n}} |
87 | | - // expected-note@-3{{make generic struct 'S9' explicitly non-Sendable to suppress this warning}} |
88 | 88 | var dict: [T : T.A] = [:] |
89 | 89 | } |
90 | 90 |
|
|
0 commit comments