Commit 7cfebf3
authored
Make
When building Swift Testing using Xcode 15.3 or the Xcode 15.3 CLTools
and a prerelease Swift 6 toolchain, the compiler produces an error:
> /Volumes/Dev/Source/swift-testing/Sources/Testing/Test.swift:69:14:
error: stored property 'xcTestCompatibleSelector' of
'Sendable'-conforming struct 'Test' has non-sendable type
'__XCTestCompatibleSelector?' (aka 'Optional<Selector>')
> 67 | /// property is always `nil`.
> 68 | @_spi(ForToolsIntegrationOnly)
> 69 | public var xcTestCompatibleSelector: __XCTestCompatibleSelector?
> | `- error: stored property 'xcTestCompatibleSelector' of
'Sendable'-conforming struct 'Test' has non-sendable type
'__XCTestCompatibleSelector?' (aka 'Optional<Selector>')
Although Xcode 15.3 is not formally supported, this is trivial to
resolve by marking the offending property `nonisolated(unsafe)`. The
property's type (`Selector?` on Darwin, `Never?` elsewhere) is
`Sendable` but `Selector` was not marked as such until Xcode 16.
This change will unblock some workflows that still use Xcode 15.3.
### 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.Test.xcTestCompatibleSelector nonisolated(unsafe) so it can be used with Xcode 15 CLTools. (#582)1 parent 33c16da commit 7cfebf3
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
0 commit comments