Closed plokhotnyuk closed 5 years ago
The reason for this is an optimization that came with 0.10.0. For members with basic types derived codecs now don't rely on the implicit codecs, but read them directly from the reader, which circumvents boxing.
So, for all non-basic types custom codecs are still picked up as before.
Theoretically this could be fixed by running implicit resolution at the macros call site for all encoders/decoders, including the ones for basic types, and comparing whether they match the default definitions. If they do we can take the shortcut, otherwise we need to go through the custom codecs. However, at this point I'm not sure that there are sufficiently important real use cases for overriding the basic codecs to justify this investment...
In previous version it worked fine:
Now it tries to parse chars as ints without taking in account a custom codec provided by the implicit and throws the following error:
But for some cases like bellow it picks the custom codec: