summaryrefslogtreecommitdiff
path: root/test/files/run/patmatnew.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2016-01-27 19:01:25 +1000
committerJason Zaugg <jzaugg@gmail.com>2016-01-29 11:10:30 +1000
commit1f4d8945f310ad803d7c165e0f53baf3c9194cf6 (patch)
treed911b6ee46c868352624f19fdf7c4b0b98bbbebe /test/files/run/patmatnew.scala
parent79a52e6807d2797dee12bab1730765441a0e222d (diff)
downloadscala-1f4d8945f310ad803d7c165e0f53baf3c9194cf6.tar.gz
scala-1f4d8945f310ad803d7c165e0f53baf3c9194cf6.tar.bz2
scala-1f4d8945f310ad803d7c165e0f53baf3c9194cf6.zip
SI-9398 Treat case classes as one-element ADTs for analysis
Currently, exhaustivity analysis only runs for scrutinees with a sealed type. This commit treats any case class as a one-element, sealed type to enable additional analysis, such as in the new test case.
Diffstat (limited to 'test/files/run/patmatnew.scala')
-rw-r--r--test/files/run/patmatnew.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/files/run/patmatnew.scala b/test/files/run/patmatnew.scala
index 3c0d00dc6c..2647d97836 100644
--- a/test/files/run/patmatnew.scala
+++ b/test/files/run/patmatnew.scala
@@ -539,7 +539,7 @@ object Test {
case class Operator(x: Int);
val EQ = new Operator(2);
- def analyze(x: Tuple2[Operator, Int]) = x match {
+ def analyze(x: Tuple2[Operator, Int]) = (x: @unchecked) match {
case (EQ, 0) => "0"
case (EQ, 1) => "1"
case (EQ, 2) => "2"
@@ -603,7 +603,7 @@ object Test {
object Bug1093 {
def run() {
- assert(Some(3) match {
+ assert((Some(3): @unchecked) match {
case Some(1 | 2) => false
case Some(3) => true
})