Skip to content

Isolation errors when building with Xcode 16.2b1 #10

Closed

Description

@tonyarnold

I'm seeing the following failures when building the latest version of ButtonKit:

/Users/tonyarnold/Library/Developer/Xcode/DerivedData/MyApp-gssxejlsmdmaqwgvadupmvxyerbe/SourcePackages/checkouts/ButtonKit/Sources/ButtonKit/Modifiers/Button+AsyncTask.swift:81:36: error: main actor-isolated property 'initialized' can not be referenced from a nonisolated autoclosure
                if task == nil && !initialized {
                                   ^
/Users/tonyarnold/Library/Developer/Xcode/DerivedData/MyApp-gssxejlsmdmaqwgvadupmvxyerbe/SourcePackages/checkouts/ButtonKit/Sources/ButtonKit/Modifiers/Button+AsyncTask.swift:72:24: note: property declared here
    @State private var initialized = false
                       ^
/Users/tonyarnold/Library/Developer/Xcode/DerivedData/MyApp-gssxejlsmdmaqwgvadupmvxyerbe/SourcePackages/checkouts/ButtonKit/Sources/ButtonKit/Modifiers/Button+AsyncTask.swift:83:21: error: main actor-isolated property 'initialized' can not be mutated from a Sendable closure
                    initialized = true
                    ^
/Users/tonyarnold/Library/Developer/Xcode/DerivedData/MyApp-gssxejlsmdmaqwgvadupmvxyerbe/SourcePackages/checkouts/ButtonKit/Sources/ButtonKit/Modifiers/Button+AsyncTask.swift:72:24: note: mutation of this property is only permitted within the actor
    @State private var initialized = false
                       ^
/Users/tonyarnold/Library/Developer/Xcode/DerivedData/MyApp-gssxejlsmdmaqwgvadupmvxyerbe/SourcePackages/checkouts/ButtonKit/Sources/ButtonKit/Modifiers/Button+AsyncTask.swift:87:17: error: call to main actor-isolated function in a synchronous nonisolated context
                handler(task)
                ^

Activity

  1. self-assigned this
    on Nov 1, 2024
  2. added
    bug
    on Nov 1, 2024
  3. Dean151 commented on Nov 1, 2024

    @Dean151
    Owner

    Thanks for your feedback! I've released 0.5.1 that solves this issue.
    I don't use Xcode beta outside of summer, so if you encounter new issues, just post them out and I'll have a Quick Look on them!

  4. added a commit that references this issue on Dec 26, 2024
    4a6e2bf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions