Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Ignoring values with didSet/willSet #10

Closed
brzzdev opened this issue Jul 4, 2023 · 3 comments · Fixed by #11
Closed

[Bug] Ignoring values with didSet/willSet #10

brzzdev opened this issue Jul 4, 2023 · 3 comments · Fixed by #11
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@brzzdev
Copy link

brzzdev commented Jul 4, 2023

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 soumyamahunt added bug Something isn't working good first issue Good for newcomers labels Jul 5, 2023
@soumyamahunt
Copy link
Contributor

soumyamahunt commented Jul 5, 2023

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

@soumyamahunt
Copy link
Contributor

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

@brzzdev
Copy link
Author

brzzdev commented Jul 5, 2023

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

soumyamahunt added a commit that referenced this issue Jul 5, 2023
…#11)

* fix: only ignore computed properties with getter in decoding/encoding
- fixes issue #10

* wip: update method doc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants