summaryrefslogtreecommitdiff
path: root/test/files/run/checked.check
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2008-07-28 18:05:50 +0000
committerIulian Dragos <jaguarul@gmail.com>2008-07-28 18:05:50 +0000
commit90200957ca0beb4db24555a2563d0a902de0078d (patch)
tree77ad1d2465b247d5df397e7e744d5a2bff459801 /test/files/run/checked.check
parent8bacd7cf469bd3097070e74e8bb72010403d21e6 (diff)
downloadscala-90200957ca0beb4db24555a2563d0a902de0078d.tar.gz
scala-90200957ca0beb4db24555a2563d0a902de0078d.tar.bz2
scala-90200957ca0beb4db24555a2563d0a902de0078d.zip
Added -Ycheckinit, which causes all getters to ...
Added -Ycheckinit, which causes all getters to check that fields are initialized before being used. It reuses the same machinery (and bitmaps) as lazy values. For now it requires the new initialization order (-Xexperimental) to work.
Diffstat (limited to 'test/files/run/checked.check')
-rw-r--r--test/files/run/checked.check35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/files/run/checked.check b/test/files/run/checked.check
new file mode 100644
index 0000000000..a1a43027f0
--- /dev/null
+++ b/test/files/run/checked.check
@@ -0,0 +1,35 @@
+checked.scala:42: warning: the semantics of this definition has changed;
+the initialization is no longer be executed before the superclass is called
+ val x = 1
+ ^
+checked.scala:19: warning: the semantics of this definition has changed;
+the initialization is no longer be executed before the superclass is called
+ val t1 = 1
+ ^
+checked.scala:20: warning: the semantics of this definition has changed;
+the initialization is no longer be executed before the superclass is called
+ var t2 = 2
+ ^
+checked.scala:53: warning: the semantics of this definition has changed;
+the initialization is no longer be executed before the superclass is called
+ val x = 1
+ ^
+checked.scala:54: warning: the semantics of this definition has changed;
+the initialization is no longer be executed before the superclass is called
+ val y = 2
+ ^
+5 warnings found
+sum = 12
+[OK] Cought UFE: Uninitialized field: checked.scala: 42
+2
+[OK] Cought UFE: Uninitialized field: checked.scala: 73
+x = 10
+y = 11
+lz1 = 1
+lz2 = 2
+[OK]: 24
+x = 10
+y = 11
+lz1 = 1
+lz2 = 2
+[OK]: 24