AppCodableStorage icon indicating copy to clipboard operation
AppCodableStorage copied to clipboard

@MainActor on property wrapper makes compiler unhappy

Open darknoon opened this issue 3 years ago • 0 comments

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.

darknoon avatar Apr 09 '22 14:04 darknoon