Created
June 18, 2013 13:03
-
-
Save markehammons/5805162 to your computer and use it in GitHub Desktop.
Classes with cyclical references cannot be pickled or unpickled. They generate out of heap space errrors.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.pickling._ | |
import json._ | |
object Test extends App { | |
val x = (new X).pickle | |
println(x) | |
x.unpickle[X] | |
} | |
class X { | |
var y = new Y(this) | |
} | |
class Y(val x: X) {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment