summaryrefslogtreecommitdiff
path: root/test/files/run/elidable.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-02-20 20:43:31 -0800
committerPaul Phillips <paulp@improving.org>2012-02-20 20:43:31 -0800
commit7a5966f9fa6f47e18b8dab080e7f629625ed093e (patch)
tree1eb3d548ab58532ad3e36a030be63048726eebd3 /test/files/run/elidable.scala
parent6fbd2a851c9103191d8fcdbcecdffb7fe3c64412 (diff)
parent61c9b4f01d99a81e15391b270bd1b5a895f65ffd (diff)
downloadscala-7a5966f9fa6f47e18b8dab080e7f629625ed093e.tar.gz
scala-7a5966f9fa6f47e18b8dab080e7f629625ed093e.tar.bz2
scala-7a5966f9fa6f47e18b8dab080e7f629625ed093e.zip
Merge remote-tracking branches 'jsuereth/2.10.0-milestones' and 'szabolcsberecz/SI-5215' into develop
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])
}
}