The following trait hierarchy cannot be serialised with uPickle:
sealed trait Delta[A, B]
object Delta {
case class Insert[A, B](key: A, value: B) extends Delta[A, B]
case class Remove[A, B](key: A) extends Delta[A, B]
case class Clear[A, B]() extends Delta[A, B]
}
The reason is that Clear[A, B]() does not bind its type parameters to arguments. As a consequence, every Clear[A, B] instance becomes Clear[Nothing, Nothing], leading to type mismatches.
The following trait hierarchy cannot be serialised with uPickle:
The reason is that
Clear[A, B]()
does not bind its type parameters to arguments. As a consequence, everyClear[A, B]
instance becomesClear[Nothing, Nothing]
, leading to type mismatches.I came up with a quick workaround (which requires https://github.com/tindzk/upickle/commit/4b1345f288b9d4a8bcbd1675503eb50f06d8cfef):
ID: 70 Original Author: tindzk