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

Only use the constructor param default if the parameter is promoted #72

Open
Crell opened this issue Oct 16, 2024 · 0 comments
Open

Only use the constructor param default if the parameter is promoted #72

Crell opened this issue Oct 16, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Crell
Copy link
Owner

Crell commented Oct 16, 2024

Detailed description

Currently, Serde tries to use the default value from a matching-name constructor parameter as a default for a property. That's fine if it's a promoted property. If there is a constructor parameter that matches the name of a separately defined property, however, and they don't have the same type, type errors can occur.

Context

Ran into this in MiDy.

Possible implementation

Should be pretty easy to add an extra isPromoted check in Field.

@Crell Crell added the bug Something isn't working label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant