diff options
author | Hubert Plociniczak <hubert.plociniczak@epfl.ch> | 2010-10-01 17:10:27 +0000 |
---|---|---|
committer | Hubert Plociniczak <hubert.plociniczak@epfl.ch> | 2010-10-01 17:10:27 +0000 |
commit | 256aca612204f1316e5281af6d10a14300d58ad1 (patch) | |
tree | 207ec6cdb99b473b9a21811d4d903ed75a289ed7 /test/files/jvm/serialization.scala | |
parent | 1148daec9c6aeba69d5d37fde877ab20b310db5b (diff) | |
download | scala-256aca612204f1316e5281af6d10a14300d58ad1.tar.gz scala-256aca612204f1316e5281af6d10a14300d58ad1.tar.bz2 scala-256aca612204f1316e5281af6d10a14300d58ad1.zip |
Another attempt for #1591.
Diffstat (limited to 'test/files/jvm/serialization.scala')
-rw-r--r-- | test/files/jvm/serialization.scala | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/files/jvm/serialization.scala b/test/files/jvm/serialization.scala index 06086f4038..b8656888c6 100644 --- a/test/files/jvm/serialization.scala +++ b/test/files/jvm/serialization.scala @@ -532,6 +532,31 @@ object Test6 { } //############################################################################ +// Nested objects cannot get readresolve automatically because after deserialization +// they would be null (they are treated as lazy vals) +@serializable +class Outer { + + @serializable + object Inner +} + +object Test7 { + val x = new Outer + x.Inner // initialize + try { + val y:Outer = read(write(x)) + if (y.Inner == null) + println("Inner object is null") + } + catch { + case e: Exception => + println("Error in Test7: " + e) + } + +} + +//############################################################################ // Test code object Test { @@ -542,6 +567,7 @@ object Test { Test4_xml Test5 Test6 + Test7 } } |