Swift 6 complete concurrency warnings
Closed this issue · 2 comments
GeorgeElsham commented
Description
After updating to Swift 6 with complete concurrency checking following Migrate your app to Swift 6, I am getting multiple warnings. One on a List
looks like so:
Static property 'v17' is not concurrency-safe because non-'Sendable' type 'PlatformViewVersion<iOSVersion, ListType, UICollectionView>' may have shared mutable state; this is an error in the Swift 6 language mode
Checklist
- I have read the README before submitting this report.
- This issue hasn't been addressed in an existing GitHub issue or discussion.
Expected behavior
It should compile with no warnings or errors.
Actual behavior
Xcode produces warnings.
Steps to reproduce
Example code:
.introspect(.list, on: .iOS(.v17)) { list in
/* ... */
}
Version information
1.1.4
Destination operating system
iOS 18.0
Xcode version information
Version 16.0 beta (16A5171c)
Swift Compiler version information
swift-driver version: 1.109.2 Apple Swift version 6.0 (swiftlang-6.0.0.3.300 clang-1600.0.20.10)
Target: arm64-apple-macosx14.0
tscdl commented
As an intermediate workaround, I think you can put this somewhere in your top level code. However, not sure if it´s correct.
extension iOSViewVersion<ScrollViewType, UIScrollView> {
nonisolated(unsafe) public static let v17 = Self(for: .v17)
}