Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a7f3b00

Browse files
committed
remove more exit calls
1 parent ae97856 commit a7f3b00

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

test/files/pos/t7591/Demo.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ object DemoSpec extends DemoSpec with Property {
4747
type ThisCommandLine = SpecCommandLine
4848
def creator(args: List[String]) =
4949
new SpecCommandLine(args) {
50-
override def errorFn(msg: String) = { println("Error: " + msg) ; sys.exit(0) }
50+
override def errorFn(msg: String) = { throw new Error("Error: " + msg) }
5151
}
5252
}
5353

test/files/presentation/random/src/Random.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ object randomserver {
6363
}
6464
catch {
6565
case e: IOException =>
66-
System.err.println("Could not listen on port: 9999.");
67-
System.exit(-1)
66+
System.err.println("Could not listen on port: 9999.")
67+
throw e
6868
}
6969
}
7070

test/files/run/fail-non-value-types.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ object Test {
3535
println(map.info)
3636
println(map.infoIn(cil))
3737
println(distinct.info)
38-
if (failed) sys.exit(1)
38+
assert(!failed)
3939
}
4040
}

test/files/run/verify-ctor.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
class Foo(val str: String) {
2+
def quit(s: Int): Nothing = ???
23
def this(arr: Array[Char]) = this({
3-
if (arr.length == 0) sys.exit(1)
4+
if (arr.length == 0) quit(1)
45
new String(arr)
56
})
67
}

0 commit comments

Comments
 (0)