scala/pickling — pull request #251 by havocp (2014-12-10 18:33:02+00:00)
Title: Add failing test for exception on unknown discriminator for sealed trait

The idea here is that for a static unpickler, it should only know
about the sealed trait subtypes available at compile time.

Right now it throws:

java.lang.ClassCastException: scala.pickling.test.Cucumber cannot be cast to scala.pickling.test.Banana

This seems to imply that somehow Cucumber gets unpickled using
runtime information. The failure should have come sooner,
as soon as we didn't recognize the discriminator ?

Here I was trying to debug a problem with compileTimeDispatchees but that
compile time dispatcher code doesn't seem to be used/reached so I may
just be entirely confused. I added helpful-error code to createCompileTimeDispatch for the
"case _" case, that doesn't seem to be used here, and I thought it would be.
The sealed-trait.scala previously used runtime dispatch because of the
issue shown in https://github.com/havocp/pickling/commit/143cb47c3183da5e7963e1c818e8b034feebcc30
but this patch modifies sealed-trait.scala such that it should be using only
static (un)picklers.