aboutsummaryrefslogtreecommitdiff
path: root/tests/neg
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-08-23 23:11:20 +0200
committerMartin Odersky <odersky@gmail.com>2015-08-23 23:11:31 +0200
commitb1aecb1a8d0c7982981296ac4bfa67d9db596e24 (patch)
tree0ed870be30732f2c9d56728cdaf29a10820f65cd /tests/neg
parent5b454b1070c3018203263f3bda21db217ed84f3f (diff)
downloaddotty-b1aecb1a8d0c7982981296ac4bfa67d9db596e24.tar.gz
dotty-b1aecb1a8d0c7982981296ac4bfa67d9db596e24.tar.bz2
dotty-b1aecb1a8d0c7982981296ac4bfa67d9db596e24.zip
Tests of functionality.
As the comment in pos/singletons.scala says, we currently test only constant propagation during typer. We should also have a test that literalize produces the literals in the right places.
Diffstat (limited to 'tests/neg')
-rw-r--r--tests/neg/singletons.scala6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/neg/singletons.scala b/tests/neg/singletons.scala
new file mode 100644
index 000000000..77e2a924f
--- /dev/null
+++ b/tests/neg/singletons.scala
@@ -0,0 +1,6 @@
+object Test {
+ final val y: 2 = { println("x"); 2 } // error: side effect
+ val a: 42 = 43 // error: different constant
+ val x = 42
+ val z: 42 = x // error: x is not final
+}