pickling icon indicating copy to clipboard operation
pickling copied to clipboard

Pickle a class where on field is enum

Open ryskajakub opened this issue 11 years ago • 19 comments

Hi, the enums are not serialized nicely. The most-specific type of the enum is not in the pickled version and the information about which value from the enumeration was pickled is completely missing.

 "source": {
   "tpe": "Enumeration.this.Val"
 }

It would be nice, if you'd look at it.

ryskajakub avatar Sep 03 '13 13:09 ryskajakub

Just a note to let you know that this is not forgotten, but that it probably won't come in the 0.8.0 release. Instead, it'll probably be handled in the 0.8.1 release which should come shortly after 0.8.0 (a matter of days/weeks most likely).

heathermiller avatar Sep 11 '13 16:09 heathermiller

OK, thanks for noticing

ryskajakub avatar Sep 11 '13 16:09 ryskajakub

Any update on this?

vovagalchenko avatar Jul 20 '14 19:07 vovagalchenko

+1

dtarima avatar Aug 28 '14 18:08 dtarima

+1

shumn avatar Sep 05 '14 14:09 shumn

+1

reid-spencer avatar Jun 13 '15 00:06 reid-spencer

+1

dodnert avatar Jul 17 '15 19:07 dodnert

+9000

danoctavian avatar Jul 20 '15 18:07 danoctavian

9000?! There's no way that can be right! It can't!

But, seriously, +1.

jewer avatar Jul 21 '15 20:07 jewer

+1

chaorace avatar Jul 28 '15 22:07 chaorace

Hey guys, this turns out to be part of a class of bugs relating to Java .class files and the scala symbol loader. We'll have to add very specific support for enum in the future. For now you HAVE to provide custom Pickler/Unpickler for these types.

In fact, in 0.11.x we'll no longer allow a pickler to be generated by the macros because we know our information about Java classes is suspect.

jsuereth avatar Aug 13 '15 19:08 jsuereth

Oh, and also I should check: Is this a java enum or a Scala enum?

jsuereth avatar Aug 13 '15 19:08 jsuereth

@jsuereth - I'm primarily interested in scala.Enumeration values.

dodnert avatar Aug 13 '15 20:08 dodnert

+1 scala.Enumeration does anybody have a working example of a custom un/pickler ?

webgress avatar Sep 24 '15 07:09 webgress

+1 Scala enum

pabloa avatar Jun 09 '16 03:06 pabloa

👍

schickling avatar Jul 16 '16 14:07 schickling

+1

Keshi avatar Jul 20 '16 17:07 Keshi

👍

oskoi avatar Nov 20 '16 21:11 oskoi

+1

bbarn3y avatar Jan 04 '17 13:01 bbarn3y