This repository was archived by the owner on Feb 20, 2019. It is now read-only.
Pickling an empty list does not produce an empty JSON array #306
Open
Description
scala> import scala.pickling._, Defaults._
import scala.pickling._
import Defaults._
scala> import json._
import json._
scala> case class Foo(list: List[String])
defined class Foo
scala> Foo(List.empty).pickle
<console>:19: warning: method newTermName in trait Names is deprecated: Use TermName instead
Foo(List.empty).pickle
^
res0: scala.pickling.json.pickleFormat.PickleType =
JSONPickle({
"$type": "Foo",
"list": {
"$type": "scala.collection.immutable.Nil.type"
}
})
I would expect list not to be an object but an empty JSON array instead