aboutsummaryrefslogtreecommitdiff
path: root/tests/neg/singletons.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-08-23 23:36:02 +0200
committerMartin Odersky <odersky@gmail.com>2015-08-23 23:36:21 +0200
commit289e273697f9304d716ed9fc834b3b2016df6f7d (patch)
tree59f14f44df86c8e10e3ae4bf694e92eaa0bb0dd9 /tests/neg/singletons.scala
parenta68cfd6457e899c9cbc04a522a79c6d1c4283ca3 (diff)
downloaddotty-289e273697f9304d716ed9fc834b3b2016df6f7d.tar.gz
dotty-289e273697f9304d716ed9fc834b3b2016df6f7d.tar.bz2
dotty-289e273697f9304d716ed9fc834b3b2016df6f7d.zip
Better error message for Null and 'sym singleton types.
Null and 'sym are not legal as singleton types because the underlying values are not stable. They are rejected now outright instead of issuing a cryptic "X is not stable" error message.
Diffstat (limited to 'tests/neg/singletons.scala')
-rw-r--r--tests/neg/singletons.scala4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/neg/singletons.scala b/tests/neg/singletons.scala
index 3bf7ee050..e4c6db060 100644
--- a/tests/neg/singletons.scala
+++ b/tests/neg/singletons.scala
@@ -2,4 +2,8 @@ object Test {
val a: 42 = 43 // error: different constant
val x = 42
val z: 42 = x // error: x is not final
+
+ val n: null = null // error: Null is not a legal singleton type
+
+ val sym: 'sym = 'sym // error: Symbol is a legal singleton type
}