You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now it tries to parse chars as ints without taking in account a custom codec provided by the implicit and throws the following error:
io.bullet.borer.Borer$Error$InvalidInputData: Expected Char but got Chars (input position 6)
at io.bullet.borer.InputReader.unexpectedDataItem(Reader.scala:536)
at io.bullet.borer.InputReader.unexpectedDataItem(Reader.scala:532)
at io.bullet.borer.InputReader.readChar(Reader.scala:85)
at HasCharDecoder$1.readObject$1(<console>:1)
at HasCharDecoder$1.read(<console>:1)
at $anon$2.read(<console>:1)
at $anon$2.read(<console>:1)
at io.bullet.borer.DecodingSetup$Impl.decodeFrom(DecodingSetup.scala:160)
at io.bullet.borer.DecodingSetup$Impl.value(DecodingSetup.scala:99)
... 36 elided
But for some cases like bellow it picks the custom codec:
The text was updated successfully, but these errors were encountered:
plokhotnyuk
changed the title
Regression in 0.10.0: cannot inject a custom codec using implicit
Regression in 0.10.0: cannot inject a custom codec using implicit during derivation of a map based codec
Jul 12, 2019
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...
sirthias
changed the title
Regression in 0.10.0: cannot inject a custom codec using implicit during derivation of a map based codec
Derived codecs don't pick up custom codecs for basic types
Jul 12, 2019
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:
The text was updated successfully, but these errors were encountered: