scala / pickling

Fast, customizable, boilerplate-free pickling support for Scala
lampwww.epfl.ch/~hmiller/pickling
BSD 3-Clause "New" or "Revised" License
831 stars 79 forks source link

Compile time serialisation failing for nested case classes with Scala 2.10.6 #441

Open ChetanBhasin opened 8 years ago

ChetanBhasin commented 8 years ago

Here is the console history:

scala> import scala.pickling._;   import scala.pickling.json._;   import scala.pickling.static._;   import scala.pickling.Defaults._;
import scala.pickling._
import scala.pickling.json._
import scala.pickling.static._
import scala.pickling.Defaults._

scala> case class Inner(name: String, age: Int)
defined class Inner

scala> case class Outer(inner: Inner, ints: List[Int])
defined class Outer

scala> val person = Outer(Inner("Chetan", 20), List(1, 2, 3))
person: Outer = Outer(Inner(Chetan,20),List(1, 2, 3))

scala> person.pickle
<console>:43: error: Cannot generate a pickler for Outer. Recompile with -Xlog-implicits for details
       person.pickle
              ^

scala> person.inner.pickle
res2: pickling.json.pickleFormat.PickleType =
JSONPickle({
  "$type": "Inner",
  "name": "Chetan",
  "age": 20
})
heathermiller commented 8 years ago

What version are you using?

ChetanBhasin commented 8 years ago

@heathermiller The version is 10.0.1