Serde icon indicating copy to clipboard operation
Serde copied to clipboard

Only use the constructor param default if the parameter is promoted

Open Crell opened this issue 1 year ago • 0 comments

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 avatar Oct 16 '24 23:10 Crell