Skip to content

Instantly share code, notes, and snippets.

@markehammons
Created June 18, 2013 13:03
Show Gist options
  • Save markehammons/5805162 to your computer and use it in GitHub Desktop.
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.
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