argonaut-shapeless
argonaut-shapeless copied to clipboard
Cannot autogenerate encoders/decoders for recursive ADTs
Trying to run this
case class Foo(id: Int, foos: Vector[Foo])
val fooE = EncodeJson.of[Foo]
results in a
java.lang.StackOverflowError
at Main$anon$mkEncodeJson$macro$33$1.inst$macro$25$lzycompute(Main.scala:24)
at Main$anon$mkEncodeJson$macro$33$1.inst$macro$25(Main.scala:24)
at Main$anon$mkEncodeJson$macro$33$1.inst$macro$21$lzycompute(Main.scala:24)
at Main$anon$mkEncodeJson$macro$33$1.inst$macro$21(Main.scala:24)
at Main$anon$mkEncodeJson$macro$33$1$$anonfun$inst$macro$5$1.apply(Main.scala:24)
at Main$anon$mkEncodeJson$macro$33$1$$anonfun$inst$macro$5$1.apply(Main.scala:24)
at shapeless.compat.Lazy$$anon$2.value$lzycompute(Lazy.scala:105)
at shapeless.compat.Lazy$$anon$2.value(Lazy.scala:105)
at argonaut.derive.ProductEncodeJson$$anon$5.apply(MkEncodeJson.scala:76)
at argonaut.derive.MkEncodeJson$$anon$12.encodeJson(MkEncodeJson.scala:161)
at argonaut.DerivedInstances$class.mkEncodeJson(Shapeless.scala:41)
at argonaut.Shapeless$.mkEncodeJson(Shapeless.scala:70)
.... (repeats for a while)
on 1.0.0-M1
and upwards, while running correctly on 0.3.1
. Same for DecodeJson
.
I've hit the same problem. Did you ever find a solution?
I've rolled back to 0.3.1, haven't updated it since.