This repository was archived by the owner on Feb 20, 2019. It is now read-only.
This repository was archived by the owner on Feb 20, 2019. It is now read-only.
Option fields in case classes are null in the constructor when unpickling #128
Closed
Description
import org.scalatest.FunSuite
import scala.pickling._, Defaults._
import json._
class Test extends FunSuite {
test("main") {
val a = A(Some(5))
val pickle = a.pickle
assert(pickle.unpickle[A] === a)
}
}
case class A(intOpt: Option[Int]) {
intOpt match {
case Some(int) ⇒
case None ⇒
}
}
results in
[info] Test:
[info] - main *** FAILED ***
[info] scala.MatchError: null
[info] at A.<init>(Test.scala:14)