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

Add support for Swift 6 #84

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Add support for Swift 6 #84

wants to merge 4 commits into from

Conversation

bbrk24
Copy link
Contributor

@bbrk24 bbrk24 commented Oct 9, 2024

Issue Link

Fixes #82

Overview of Changes

  • I added Swift 6 to the list of supported Swift versions
    • This has to be .version("6") rather than .v6 in the Package.swift, because Xcode 15 and earlier don't know about .v6
  • Some changes to make the library compile in Swift 6:
    • Scope was marked as Sendable. There's no reason it can't be, and without being explicitly Sendable it complained about the static lets.
    • The dynamic member subscript on Store.Wrapper is now explicitly @MainActor. Key paths are not necessarily sendable, and it's only meant to be called in views (= on the main actor) anyways.
    • Synchronizer now explicitly inherits Sendable. There's no way to correctly implement it with a non-sendable type anyways.
    • ErrorCheckMode conforms to BitwiseCopyable. This wasn't strictly necessary, but non-public enums with no payloads do this implicitly, and we aren't going to add any payloads (as indicated by the comment inside the enum), so there's no reason not to add it.
  • I added an iOS 18 example by copying the iOS 14 example, removing Mockingbird, and changing the Swift language version to Swift 6. Its tests should be automatically skipped if you run the test script with Xcode 15 or earlier.

Anything you want to highlight?

N/A

Test Plan

The automated tests should pass in both Xcode 15 and 16, and Dependiject itself should compile without errors or warnings in both.

@bbrk24 bbrk24 requested review from wboyd600 and Ljgleeson October 9, 2024 19:16
@bbrk24 bbrk24 requested review from RolandDoll and removed request for wboyd600 October 11, 2024 19:09
Copy link
Contributor

@Ljgleeson Ljgleeson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm this runs without warnings in Xcode 15. Will get back to this later to fully review in Xcode 16

@RolandDoll RolandDoll removed their request for review January 9, 2025 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for Swift 6
2 participants