Serde
Serde copied to clipboard
Only use the constructor param default if the parameter is promoted
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.