SwiftyLab / MetaCodable

Supercharge Swift's Codable implementations with macros meta-programming.
https://swiftpackageindex.com/SwiftyLab/MetaCodable/main/documentation/metacodable
MIT License
604 stars 22 forks source link

[Bug] Ignoring values with didSet/willSet #10

Closed brzzdev closed 1 year ago

brzzdev commented 1 year ago

I think by trying to ignore computed variables, you've inadvertently ignored values with didSet and willSet

Since updating to a more recent version I now get the error Return from initializer without initializing all stored properties when my struct contains something like

var example: String {
    didSet {
        // do something
    }
}
soumyamahunt commented 1 year ago

I think the correct approach will be to check for only get accessor or getter only.

soumyamahunt commented 1 year ago

@brzzdev can you check if PR #11 is working for you.

brzzdev commented 1 year ago

It is indeed! The expanded macro looks exactly like I would expect too 😄