diff options
author | Martin Odersky <odersky@gmail.com> | 2015-08-23 23:37:00 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-08-23 23:37:00 +0200 |
commit | e850a99f16004a702b5fa63736ac215fc388051b (patch) | |
tree | a24d2bfcb93c385d118f50b7cb71dd902108820e /tests/pos/singletons.scala | |
parent | 289e273697f9304d716ed9fc834b3b2016df6f7d (diff) | |
download | dotty-e850a99f16004a702b5fa63736ac215fc388051b.tar.gz dotty-e850a99f16004a702b5fa63736ac215fc388051b.tar.bz2 dotty-e850a99f16004a702b5fa63736ac215fc388051b.zip |
Test other forms of singleton types.
Tested are now other numeric values, strings, booleans, which are
all legal singleton types.
Diffstat (limited to 'tests/pos/singletons.scala')
-rw-r--r-- | tests/pos/singletons.scala | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/tests/pos/singletons.scala b/tests/pos/singletons.scala index 55f9b5ecb..4ce41a061 100644 --- a/tests/pos/singletons.scala +++ b/tests/pos/singletons.scala @@ -12,8 +12,17 @@ object Test { val b: 2 = a def f: 3 = 3 - val c = f + final val c = f + val dc: 3.0 = 3.0 + final val dc1 = dc + val fc: 3.0f = 3.0f + final val fc1 = fc + + val t: true = true + + val str: "" = "" + final val str2 = str } /* To do: test that after erasure we have generated code like this: * @@ -34,7 +43,14 @@ package <empty> { } <accessor> def b(): Int = 2 def f(): Int = 3 - <accessor> def c(): Int = Test.f() + final <accessor> def c(): Int = Test.f() + <accessor> def dc(): Double = 3.0 + final <accessor> def dc1(): Double = 3.0 + <accessor> def fc(): Float = 3.0 + final <accessor> def fc1(): Float = 3.0 + <accessor> def t(): Boolean = true + <accessor> def str(): String = "" + final <accessor> def str2(): String = "" } } */ |