Skip to content

Commit 33ffe33

Browse files
authored
Fix a sendability warning in a test fixture. (#430)
This PR fixes the aforementioned sendability warning. It adds an additional fixture to ensure we're testing the original case (nested `Self` usage.) ### Checklist: - [x] Code and documentation should follow the style of the [Style Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md). - [x] If public symbols are renamed or modified, DocC references should be updated.
1 parent 4217042 commit 33ffe33

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Tests/TestingTests/MiscellaneousTests.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ actor ActorTests {
155155
struct TestsWithStaticMemberAccessBySelfKeyword {
156156
static let x = 0 ..< 100
157157

158-
static func f(max: Int) -> Range<Int> {
158+
@Sendable static func f(max: Int) -> Range<Int> {
159159
0 ..< max
160160
}
161161

@@ -168,6 +168,13 @@ struct TestsWithStaticMemberAccessBySelfKeyword {
168168
@Test(.hidden, arguments: [Self.f(max:)])
169169
func h(i: @Sendable (Int) -> Range<Int>) {}
170170

171+
struct Box<RawValue>: Sendable, RawRepresentable where RawValue: Sendable {
172+
var rawValue: RawValue
173+
}
174+
175+
@Test(.hidden, arguments: [Box(rawValue: Self.f(max:))])
176+
func j(i: Box<@Sendable (Int) -> Range<Int>>) {}
177+
171178
struct Nested {
172179
static let x = 0 ..< 100
173180
}

0 commit comments

Comments
 (0)