suzaku-io / boopickle

Binary serialization library for efficient network communication

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Won't compile for a combination of nested Seq/case classes

douglaz opened this issue · comments

boopickle 1.2.6
This is the minimal test case I've come with:

case class Element(data: Option[Seq[String]])
case class Container(e: Seq[Element])

object Test {
  import boopickle.Default._

  def serializer(c: Container) = Pickle.intoBytes(c)
}

The error is:

Error:(7, 50) Cannot materialize pickler for non-case class: Seq[Element]. If this is a collection, the error can refer to the class inside.
  def serializer(c: Container) = Pickle.intoBytes(c)

Yeah, this is a known issue in the way the macro and Scala compiler works (duplicates #21 ) and you can find a workaround #21