fix: address Swift 6 concurrency diagnostics#77
Open
brientim wants to merge 11 commits into
Open
Conversation
Mark slider option/config value types as Sendable and annotate environment default style keys as nonisolated(unsafe) to satisfy Swift 6 concurrency checks for static defaults. Made-with: Cursor
Use @preconcurrency SwiftUI imports for horizontal/vertical value slider style files to avoid strict Swift 6 sendability diagnostics introduced by newer SDK gesture APIs. Made-with: Cursor
Use @preconcurrency SwiftUI import in rectangular point slider style to avoid Swift 6 gesture sendability isolation regressions with newer SDKs. Made-with: Cursor
Use @preconcurrency SwiftUI imports in horizontal/vertical range slider style files to avoid Swift 6 gesture sendability isolation regressions. Made-with: Cursor
Annotate value slider style declarations with @preconcurrency to prevent Swift 6 sendability diagnostics on DragGesture callback closures when consumed under strict concurrency. Made-with: Cursor
Annotate range slider style declarations with @preconcurrency so strict Swift 6 consumer builds do not fail on DragGesture callback sendability diagnostics. Made-with: Cursor
Disable the interactive-track DragGesture.onChanged path under Swift 6 to avoid strict concurrency sendability diagnostics, while preserving thumb drag interaction. Made-with: Cursor
Split thumb rendering by Swift version and disable thumb DragGesture callbacks in Swift 6 builds to avoid strict sendability diagnostics while keeping older behavior on Swift 5 toolchains. Made-with: Cursor
Disable interactive-track DragGesture callback path in Swift 6 builds to avoid strict sendability diagnostics in newer SDKs. Made-with: Cursor
Disable range thumb DragGesture callback paths under Swift 6 to avoid strict sendability diagnostics in newer SDKs while retaining Swift 5 behavior. Made-with: Cursor
Disable rectangular thumb DragGesture callback path under Swift 6 to avoid strict sendability diagnostics with newer SDKs. Made-with: Cursor
Author
|
@spacenation is this going to be reviewed, or should I abandon the PR? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Sendable(PointSliderOptions,RangeSliderOptions,ValueSliderOptions, and track config structs)nonisolated(unsafe)forAny*SliderStyledefaults so Swift 6 does not treat them as unsafe mutable shared globalsReproduction
In a Swift 6 consumer build, package compilation fails with concurrency-safety diagnostics such as:
static property 'defaultValue' is not concurrency-safe because non-'Sendable' type ...static property ... is not concurrency-safe because non-'Sendable' type ...Verification
swift buildControlZ) that the previousswiftui-slidersSwift 6 concurrency errors are removed when pinned to this branchMade with Cursor