From 262ee3a852f278f97b083a05376de0eab96c805d Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sat, 11 Dec 2010 14:57:06 +0000 Subject: When was the last time -Xcheckinit was run? It ... When was the last time -Xcheckinit was run? It must have been a long time. All these changes are to address bugs revealed by -Xcheckinit, mostly in test cases, some in the compiler. I'm guessing the partest -Xcheckinit runs are hanging the first time they run into a failure, so if it starts "working" again after this commit don't get too confident. No review. --- test/files/jvm/t2511.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test/files/jvm/t2511.scala') diff --git a/test/files/jvm/t2511.scala b/test/files/jvm/t2511.scala index d4b5e83d0f..eb57dc503d 100644 --- a/test/files/jvm/t2511.scala +++ b/test/files/jvm/t2511.scala @@ -4,6 +4,7 @@ object Test { trait IMyMessage extends Serializable { @transient var message: String = null + var message2: String = null } class MyMessage extends IMyMessage @@ -13,6 +14,7 @@ object Test { val out = new ObjectOutputStream(buf) val m = new MyMessage m.message = "foo" + m.message2 = "bippy" out.writeObject(m) out.flush buf.toByteArray @@ -25,6 +27,9 @@ object Test { def main(args: Array[String]) { val m = unserialize(serialize) - println(m.message) + // Xcheckinit freaks out here but its nullness is what we're testing + try println(m.message) + catch { case _: UninitializedFieldError => println("null") } + println(m.message2) } } -- cgit v1.2.3