circe
circe copied to clipboard
Error message when deriving for List[A] in Scala 3 needs improvement
Currently, when you try to either derive Encoder[List[A]]
directly (by deriveEncoder[List[A]]
) or indirectly (by deriving for a type that contains a List[A]
) with semiauto and there doesn't exist an Encoder[A]
, you get an error message that really isn't all that helpful:
Maximal number of successive inlines (32) exceeded,
Maybe this is caused by a recursive inline method?
You can use -Xmax-inlines to change the limit.
The problem here is that the Scala 3 derivation code tries to auto-derive Encoder[List[A]]
(which is insane) when it cannot use Encoder.encodeList[A]
because of missing Encoder[A]
.
Here is a scastie example showing it off: https://scastie.scala-lang.org/heksesang/z1VPL9zST2S9tmRwMz5oJg/1
Can repro, I tried to get around it temporarily by increasing max inlines but got StackOverflow.
Any updates on this?