summaryrefslogtreecommitdiff
path: root/test/files/neg/elide-to-nothing.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/neg/elide-to-nothing.scala')
-rw-r--r--test/files/neg/elide-to-nothing.scala31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/files/neg/elide-to-nothing.scala b/test/files/neg/elide-to-nothing.scala
new file mode 100644
index 0000000000..5008e8bc1d
--- /dev/null
+++ b/test/files/neg/elide-to-nothing.scala
@@ -0,0 +1,31 @@
+
+/** Test which should fail compilation */
+class ElysianFailed {
+
+ import ElysianField._
+
+ // fine
+ val a: Int = myInt
+
+ // fine
+ unimplemented()
+
+ // not fine
+ val b: Nothing = unimplemented()
+
+}
+
+object ElysianField {
+
+ import annotation.elidable
+
+ @elidable(100) def unimplemented(): Nothing = throw new UnsupportedOperationException
+
+ @elidable(100) def myInt: Int = 17
+
+}
+
+
+
+
+