{"action":"opened","issue":{"url":"https://api.github.com/repos/scala/pickling/issues/324","labels_url":"https://api.github.com/repos/scala/pickling/issues/324/labels{/name}","comments_url":"https://api.github.com/repos/scala/pickling/issues/324/comments","events_url":"https://api.github.com/repos/scala/pickling/issues/324/events","html_url":"https://github.com/scala/pickling/issues/324","id":70250166,"number":324,"title":"Should this Set pickle-unpickle with val fail?","user":{"login":"cos","id":37514,"avatar_url":"https://avatars.githubusercontent.com/u/37514?v=3","gravatar_id":"","url":"https://api.github.com/users/cos","html_url":"https://github.com/cos","followers_url":"https://api.github.com/users/cos/followers","following_url":"https://api.github.com/users/cos/following{/other_user}","gists_url":"https://api.github.com/users/cos/gists{/gist_id}","starred_url":"https://api.github.com/users/cos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cos/subscriptions","organizations_url":"https://api.github.com/users/cos/orgs","repos_url":"https://api.github.com/users/cos/repos","events_url":"https://api.github.com/users/cos/events{/privacy}","received_events_url":"https://api.github.com/users/cos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-22T22:20:26Z","updated_at":"2015-04-22T22:20:26Z","closed_at":null,"body":"```scala\r\nscala> import scala.pickling.Defaults._, scala.pickling.json._\r\nimport scala.pickling.Defaults._\r\nimport scala.pickling.json._\r\n\r\nscala> case class Foo(bar: Set[Int]) { val barSize = bar.size }\r\ndefined class Foo\r\n\r\nscala> Foo(Set()).pickle\r\nres27: pickling.json.pickleFormat.PickleType =\r\nJSONPickle({\r\n  \"$type\": \"Foo\",\r\n  \"bar\": {\r\n    \"$type\": \"scala.collection.immutable.Set[scala.Int]\",\r\n    \"elems\": [\r\n\r\n    ]\r\n  }\r\n})\r\n\r\nscala> res27.unpickle[Foo]\r\njava.lang.NullPointerException\r\n  ... 49 elided\r\n\r\nscala> lastException.printStackTrace\r\njava.lang.NullPointerException\r\n\tat $line57.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$Foo.<init>(<console>:22)\r\n\tat $line59.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$line57$read$iw$iw$iw$iw$iw$iw$iw$iw$iw$iw$iw$iwFooUnpickler$macro$49$2$.unpickle(<console>:26)\r\n\tat scala.pickling.Unpickler$class.unpickleEntry(Pickler.scala:79)\r\n\tat $line59.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$line57$read$iw$iw$iw$iw$iw$iw$iw$iw$iw$iw$iw$iwFooUnpickler$macro$49$2$.unpickleEntry(<console>:26)\r\n\tat scala.pickling.functions$.unpickle(functions.scala:11)\r\n\tat scala.pickling.UnpickleOps.unpickle(Ops.scala:23)\r\n\tat $line59.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$.<init>(<console>:26)\r\n\tat $line59.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$.<clinit>(<console>)\r\n\tat $line59.$eval$.$print$lzycompute(<console>:7)\r\n\tat $line59.$eval$.$print(<console>:6)\r\n\tat $line59.$eval.$print(<console>)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:483)\r\n\tat scala.tools.nsc.interpreter.IMain$ReadEvalPrint.call(IMain.scala:773)\r\n\tat scala.tools.nsc.interpreter.IMain$Request.loadAndRun(IMain.scala:1020)\r\n\tat scala.tools.nsc.interpreter.IMain$WrappedRequest$$anonfun$loadAndRunReq$1.apply(IMain.scala:627)\r\n\tat scala.tools.nsc.interpreter.IMain$WrappedRequest$$anonfun$loadAndRunReq$1.apply(IMain.scala:626)\r\n\tat scala.reflect.internal.util.ScalaClassLoader$class.asContext(ScalaClassLoader.scala:31)\r\n\tat scala.reflect.internal.util.AbstractFileClassLoader.asContext(AbstractFileClassLoader.scala:19)\r\n\tat scala.tools.nsc.interpreter.IMain$WrappedRequest.loadAndRunReq(IMain.scala:626)\r\n\tat scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:558)\r\n\tat scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:554)\r\n\tat scala.tools.nsc.interpreter.ILoop.reallyInterpret$1(ILoop.scala:804)\r\n\tat scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:849)\r\n\tat scala.tools.nsc.interpreter.ILoop.command(ILoop.scala:707)\r\n\tat scala.tools.nsc.interpreter.ILoop.processLine(ILoop.scala:405)\r\n\tat scala.tools.nsc.interpreter.ILoop.loop(ILoop.scala:431)\r\n\tat scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply$mcZ$sp(ILoop.scala:920)\r\n\tat scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply(ILoop.scala:906)\r\n\tat scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply(ILoop.scala:906)\r\n\tat scala.reflect.internal.util.ScalaClassLoader$.savingContextLoader(ScalaClassLoader.scala:97)\r\n\tat scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:906)\r\n\tat scala.tools.nsc.interpreter.ILoop.main(ILoop.scala:931)\r\n\tat xsbt.ConsoleInterface.run(ConsoleInterface.scala:69)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:483)\r\n\tat sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:102)\r\n\tat sbt.compiler.AnalyzingCompiler.console(AnalyzingCompiler.scala:77)\r\n\tat sbt.Console.sbt$Console$$console0$1(Console.scala:23)\r\n\tat sbt.Console$$anonfun$apply$2$$anonfun$apply$1.apply$mcV$sp(Console.scala:24)\r\n\tat sbt.Console$$anonfun$apply$2$$anonfun$apply$1.apply(Console.scala:24)\r\n\tat sbt.Console$$anonfun$apply$2$$anonfun$apply$1.apply(Console.scala:24)\r\n\tat sbt.Logger$$anon$4.apply(Logger.scala:90)\r\n\tat sbt.TrapExit$App.run(TrapExit.scala:244)\r\n\tat java.lang.Thread.run(Thread.java:745)\r\n```"}}