Skip to content

@MainActor on property wrapper makes compiler unhappy #1

@darknoon

Description

@darknoon

I get this error compiling on more recent toolchains

Expression requiring global actor 'MainActor' cannot appear in default-value expression of property '_value'; this is an error in Swift 6

I don't see how to resolve this… internal to AppCodableStorage.init() it wants to grab the correct DefaultsWriter, which is protected by being annotated @MainActor, so this would have to cascade throughout the system and it would be back to implicit queue affinity rather than using actor isolation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions