diff options
Diffstat (limited to 'test/files/run/elidable.scala')
-rw-r--r-- | test/files/run/elidable.scala | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/files/run/elidable.scala b/test/files/run/elidable.scala index 6a603084b7..02785972bb 100644 --- a/test/files/run/elidable.scala +++ b/test/files/run/elidable.scala @@ -1,6 +1,8 @@ import annotation._ import elidable._ +// runs -Xelide-below WARNING or 900 + trait T { @elidable(FINEST) def f1() @elidable(SEVERE) def f2() @@ -38,6 +40,13 @@ object Test { @elidable(FINEST) def fd() = 1.0 @elidable(FINEST) def fe() = "s" + /* variable elisions? see test/files/neg/t10068.scala + @elidable(INFO) val goner1: Int = { assert(false, "Should have been elided.") ; 42 } + @elidable(INFO) lazy val goner2: Int = { assert(false, "Should have been elided.") ; 42 } + @elidable(INFO) var goner3: Int = { assert(false, "Should have been elided.") ; 42 } + @elidable(INFO) var goner4: Nothing = _ + */ + def main(args: Array[String]): Unit = { f1() f2() @@ -80,5 +89,17 @@ object Test { Class.forName(className).getMethod(methodName) } } + + // variable elisions? + /* + assert(goner1 == 0) + assert(goner2 == 0) + assert(goner3 == 0) + try assert(goner4 == null) + catch { + case _: NullPointerException => println("NPE") + case _: NotImplementedError => println("NIE") + } + */ } } |