Open
Description
This simple recursive data structure fails to derive an Encoder:
sealed trait Tree;
case class Branch(l: Tree, r: Tree) extends Tree;
case object Leaf extends Tree;
With this error:
Welcome to Scala 3.2.2 (17.0.6, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
scala> import _root_.io.circe._
scala> sealed trait Tree; case class Branch(l: Tree, r: Tree) extends Tree; case object Leaf extends Tree;;Encoder.AsObject.derived[Tree]
-- Error: ----------------------------------------------------------------------
1 |sealed trait Tree; case class Branch(l: Tree, r: Tree) extends Tree; case object Leaf extends Tree;;Encoder.AsObject.derived[Tree]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| 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.
|---------------------------------------------------------------------------
|Inline stack trace
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|This location contains code that was inlined from rs$line$2:1
20 | case _: Mirror.Of[A] => ConfiguredEncoder.derived[A]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|This location contains code that was inlined from rs$line$2:1
15 | case _: (t *: ts) => summonEncoder[t] :: summonEncoders[ts]
| ^^^^^^^^^^^^^^^^
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|This location contains code that was inlined from rs$line$2:1
32 | lazy val elemEncoders: List[Encoder[?]] = summonEncoders[mirror.MirroredElemTypes]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|This location contains code that was inlined from rs$line$2:1
20 | case _: Mirror.Of[A] => ConfiguredEncoder.derived[A]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|This location contains code that was inlined from rs$line$2:1
15 | case _: (t *: ts) => summonEncoder[t] :: summonEncoders[ts]
| ^^^^^^^^^^^^^^^^
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|This location contains code that was inlined from rs$line$2:1
32 | lazy val elemEncoders: List[Encoder[?]] = summonEncoders[mirror.MirroredElemTypes]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|This location contains code that was inlined from rs$line$2:1
20 | case _: Mirror.Of[A] => ConfiguredEncoder.derived[A]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|This location contains code that was inlined from rs$line$2:1
15 | case _: (t *: ts) => summonEncoder[t] :: summonEncoders[ts]
| ^^^^^^^^^^^^^^^^
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|This location contains code that was inlined from rs$line$2:1
32 | lazy val elemEncoders: List[Encoder[?]] = summonEncoders[mirror.MirroredElemTypes]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
.........