Closed mschonvogel closed 9 months ago
Hi @mschonvogel, this is just a problem with Swift macros in general. It won't work with Swift's @Observable
macro or SwiftUI's @Model
macro either:
@Observable
class Foo { var count = 0 } // 🛑
@Model
class Bar { var count = 0 } // 🛑
Since this is not an issue with the library I am going to convert it to a discussion.
Description
When using a
propertyWrapper
in the state in combination with the@ObservableState
macro, it causes a compiler error:Here's a reproducible project: TCAState PropertyWrapper.zip
Here's an example
propertyWrapper
:State:
Checklist
main
branch of this package.Expected behavior
The project should compile successfully (as prior to updating to the
@ObservableState
macro)Actual behavior
Error while compiling
Steps to reproduce
No response
The Composable Architecture version information
1.8.2
Destination operating system
iOS 17
Xcode version information
15.2
Swift Compiler version information