Browse files

SI-7006 Fix the unreachable test

The unreachable test was missing the cases when Random.nextInt returned
a negative number. This commit fixes that.
  • Loading branch information...
1 parent 14d51f4 commit 9f6b7bc4e82b29756755e6ea0eaa69de96adee75 @JamesIry JamesIry committed Mar 8, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 test/files/run/unreachable.scala
View
6 test/files/run/unreachable.scala
@@ -93,17 +93,17 @@ object Test extends App {
x match {
case 0 => return 0
case 1 => return 1
- case _ => error("wtf")
+ case -1 => return 2
}
- 2
+ 3
}
def unreachableAfterSwitch: Int = {
val x = util.Random.nextInt % 2
x match {
case 0 => return 42
case 1 => return 41 + x
- case _ => error("wtf")
+ case -1 => return 43 + x
}
2
}

0 comments on commit 9f6b7bc

Please sign in to comment.