diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/elide-to-nothing.check | 4 | ||||
-rw-r--r-- | test/files/neg/elide-to-nothing.flags | 1 | ||||
-rw-r--r-- | test/files/neg/elide-to-nothing.scala | 31 | ||||
-rw-r--r-- | test/files/neg/implicits.check | 5 | ||||
-rw-r--r-- | test/files/neg/implicits.scala | 16 | ||||
-rw-r--r-- | test/files/run/si5171.check | 1 | ||||
-rw-r--r-- | test/files/run/si5171.scala | 7 |
7 files changed, 64 insertions, 1 deletions
diff --git a/test/files/neg/elide-to-nothing.check b/test/files/neg/elide-to-nothing.check new file mode 100644 index 0000000000..3ef05aac9a --- /dev/null +++ b/test/files/neg/elide-to-nothing.check @@ -0,0 +1,4 @@ +elide-to-nothing.scala:14: error: Cannot elide where Nothing is required. + val b: Nothing = unimplemented() + ^ +one error found diff --git a/test/files/neg/elide-to-nothing.flags b/test/files/neg/elide-to-nothing.flags new file mode 100644 index 0000000000..59a512e547 --- /dev/null +++ b/test/files/neg/elide-to-nothing.flags @@ -0,0 +1 @@ +-Xelide-below 500 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 + +} + + + + + diff --git a/test/files/neg/implicits.check b/test/files/neg/implicits.check index cd9dfebf48..6d61f7f222 100644 --- a/test/files/neg/implicits.check +++ b/test/files/neg/implicits.check @@ -8,4 +8,7 @@ implicits.scala:46: error: type mismatch; required: List[Mxml] children.toList.flatMap ( e => { ^ -two errors found +implicits.scala:66: error: could not find implicit value for parameter x: Nothing + foo { + ^ +three errors found diff --git a/test/files/neg/implicits.scala b/test/files/neg/implicits.scala index e908fb03e8..878d3a7c99 100644 --- a/test/files/neg/implicits.scala +++ b/test/files/neg/implicits.scala @@ -56,3 +56,19 @@ class Mxml { } } + +// SI-5316 +class Test3 { + def foo(p: => Any)(implicit x: Nothing): Unit = () + + object X + + foo { + val a = 0 + + { + import X._ + a + } + } +} diff --git a/test/files/run/si5171.check b/test/files/run/si5171.check new file mode 100644 index 0000000000..159606d35c --- /dev/null +++ b/test/files/run/si5171.check @@ -0,0 +1 @@ +IsList diff --git a/test/files/run/si5171.scala b/test/files/run/si5171.scala new file mode 100644 index 0000000000..eb8029df80 --- /dev/null +++ b/test/files/run/si5171.scala @@ -0,0 +1,7 @@ +abstract sealed class ArgNumber +case object IsList extends ArgNumber +case object ArgNumber + +object Test extends App { + println(IsList) +} |