Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift 6 complete concurrency warnings #418

Open
2 tasks done
GeorgeElsham opened this issue Jun 11, 2024 · 2 comments · May be fixed by #422 or #424
Open
2 tasks done

Swift 6 complete concurrency warnings #418

GeorgeElsham opened this issue Jun 11, 2024 · 2 comments · May be fixed by #422 or #424
Labels
bug Something isn't working

Comments

@GeorgeElsham
Copy link

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

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
@GeorgeElsham GeorgeElsham added the bug Something isn't working label Jun 11, 2024
@tscdl
Copy link

tscdl commented Jun 13, 2024

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)
}

@Alex293
Copy link

Alex293 commented Jun 18, 2024

I’ll work on this today after a brief attempt this is easily achievable by stabbing some Sendable conformances and annotating most things with main actor. There is one thing that might be tricky, the debug helper.

First quick draft: #422

This was referenced Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants