Skip to content
This repository
Browse code

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...
commit 9f6b7bc4e82b29756755e6ea0eaa69de96adee75 1 parent 14d51f4
James Iry JamesIry authored

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. +3 3 test/files/run/unreachable.scala
6 test/files/run/unreachable.scala
@@ -93,9 +93,9 @@ object Test extends App {
93 93 x match {
94 94 case 0 => return 0
95 95 case 1 => return 1
96   - case _ => error("wtf")
  96 + case -1 => return 2
97 97 }
98   - 2
  98 + 3
99 99 }
100 100
101 101 def unreachableAfterSwitch: Int = {
@@ -103,7 +103,7 @@ object Test extends App {
103 103 x match {
104 104 case 0 => return 42
105 105 case 1 => return 41 + x
106   - case _ => error("wtf")
  106 + case -1 => return 43 + x
107 107 }
108 108 2
109 109 }

0 comments on commit 9f6b7bc

Please sign in to comment.
Something went wrong with that request. Please try again.