summaryrefslogtreecommitdiff
path: root/test/files/run/elidable.scala
diff options
context:
space:
mode:
authorSzabolcs Berecz <szabolcs.berecz@gmail.com>2012-02-20 21:34:55 +0100
committerSzabolcs Berecz <szabolcs.berecz@gmail.com>2012-02-20 23:36:54 +0100
commit61c9b4f01d99a81e15391b270bd1b5a895f65ffd (patch)
tree359881a8e9de12c6ae867cd2f0cfbd2830f5fc2a /test/files/run/elidable.scala
parenta6a9684f5ba5df146be1f24bd170e97f0b2208ce (diff)
downloadscala-61c9b4f01d99a81e15391b270bd1b5a895f65ffd.tar.gz
scala-61c9b4f01d99a81e15391b270bd1b5a895f65ffd.tar.bz2
scala-61c9b4f01d99a81e15391b270bd1b5a895f65ffd.zip
Fix for SI-5215 part 2: generate return value when eliding method calls
Diffstat (limited to 'test/files/run/elidable.scala')
-rw-r--r--test/files/run/elidable.scala30
1 files changed, 29 insertions, 1 deletions
diff --git a/test/files/run/elidable.scala b/test/files/run/elidable.scala
index 5015b1470b..e4ea92b72f 100644
--- a/test/files/run/elidable.scala
+++ b/test/files/run/elidable.scala
@@ -26,7 +26,18 @@ object Test {
@elidable(INFO) def f2() = assert(false, "Should have been elided.")
@elidable(SEVERE) def f3() = println("Good for me, I was not elided. Test.f3")
@elidable(INFO) def f4 = assert(false, "Should have been elided (no parens).")
-
+
+ @elidable(FINEST) def f5() = {}
+ @elidable(FINEST) def f6() = true
+ @elidable(FINEST) def f7() = 1:Byte
+ @elidable(FINEST) def f8() = 1:Short
+ @elidable(FINEST) def f9() = 1:Char
+ @elidable(FINEST) def fa() = 1
+ @elidable(FINEST) def fb() = 1l
+ @elidable(FINEST) def fc() = 1.0f
+ @elidable(FINEST) def fd() = 1.0
+ @elidable(FINEST) def fe() = "s"
+
def main(args: Array[String]): Unit = {
f1()
f2()
@@ -43,6 +54,18 @@ object Test {
c.f3()
c.f4()
+ // make sure a return value is still available when eliding a call
+ println(f5())
+ println(f6())
+ println(f7())
+ println(f8())
+ println(f9())
+ println(fa())
+ println(fb())
+ println(fc())
+ println(fd())
+ println(fe())
+
// this one won't show up in the output because a call to f1 is elidable when accessed through T
(c:T).f1()
@@ -52,6 +75,11 @@ object Test {
Class.forName(className).getMethod(methodName)
}
}
+ List("Test", "Test$") foreach { className =>
+ List("f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe") foreach { methodName =>
+ Class.forName(className).getMethod(methodName)
+ }
+ }
Class.forName("T$class").getMethod("f3", classOf[T])
}
}