summaryrefslogtreecommitdiff
path: root/test/files/neg/constructor-init-order.check
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-03-12 07:39:54 -0700
committerPaul Phillips <paulp@improving.org>2013-03-12 09:31:25 -0700
commit089cad8f436e1bc0935218937590897f5b9cbae4 (patch)
tree1d43901950f88f918a9d76b17f1c64ec2d49c677 /test/files/neg/constructor-init-order.check
parenta41c79bb5b2f16d8f37e253737f67171e5764bb9 (diff)
downloadscala-089cad8f436e1bc0935218937590897f5b9cbae4.tar.gz
scala-089cad8f436e1bc0935218937590897f5b9cbae4.tar.bz2
scala-089cad8f436e1bc0935218937590897f5b9cbae4.zip
Warn about locally identifiable init order issues.
This warns about a subset of initialization order issues which can easily be identified by inspection, such as val x = y val y = 5 The likelihood of this formulation being intentional is miniscule.
Diffstat (limited to 'test/files/neg/constructor-init-order.check')
-rw-r--r--test/files/neg/constructor-init-order.check9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/files/neg/constructor-init-order.check b/test/files/neg/constructor-init-order.check
new file mode 100644
index 0000000000..9ab6ac5923
--- /dev/null
+++ b/test/files/neg/constructor-init-order.check
@@ -0,0 +1,9 @@
+constructor-init-order.scala:7: warning: Reference to uninitialized value baz
+ val bar1 = baz // warn
+ ^
+constructor-init-order.scala:17: warning: Reference to uninitialized variable baz
+ var bar1 = baz // warn
+ ^
+error: No warnings can be incurred under -Xfatal-warnings.
+two warnings found
+one error found