I'm trying to use scala-pickling because the site in github makes it look like a very simple tool to use . The fact is that I am not able to make the simple statement (REPL) work:
scala> import scala.pickling._
import scala.pickling._
scala> import scala.pickling.Defaults._
import scala.pickling.Defaults._
scala> import binary._
import binary._
scala> class Xpto { var a = 0D; var b = 0 }
defined class Xpto
scala> val v = new Xpto { a = 1.23; b = 5 }
v: Xpto = $anon$1@636d2b03
scala> v.pickle
<console>:19: error: type mismatch;
found : v.type (with underlying type Xpto)
required: ?{def pickle: ?}
Note that implicit conversions are not applicable because they are ambiguous:
both method PickleOps in package pickling of type [T](picklee: T)pickling.PickleOps[T]
and method pickleOps in trait Ops of type [T](picklee: T)scala.pickling.PickleOps[T]
are possible conversion functions from v.type to ?{def pickle: ?}
v.pickle
^
<console>:19: error: value pickle is not a member of Xpto
v.pickle
^
What can I be doing wrong?
Note: I am using the following reference in build.sbt :
"org.scala-lang.modules" %% "scala-pickling" % "0.10.1"