Skip to content

Commit ac71296

Browse files
committed
Rethrow stackless parse error
1 parent 28a0417 commit ac71296

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

Diff for: compiler/src/dotty/tools/dotc/ast/MainProxies.scala

+3-2
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,9 @@ object MainProxies {
9696
EmptyTree,
9797
Block(
9898
List(Apply(ref(defn.CLP_showError.termRef), errVar :: Nil)),
99-
Apply(Select(Select(Select(Ident(termName("java")), termName("lang")), termName("System")), termName("exit")),
100-
List(Literal(Constant(1))))
99+
Throw(errVar)
100+
//Apply(Select(Select(Select(Ident(termName("java")), termName("lang")), termName("System")), termName("exit")),
101+
// List(Literal(Constant(1))))
101102
)
102103
)
103104
val body = Try(call, handler :: Nil, EmptyTree)

Diff for: library/src/scala/util/CommandLineParser.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ object CommandLineParser {
99
* @param idx The index of the argument that's faulty (starting from 0)
1010
* @param msg The error message
1111
*/
12-
class ParseError(val idx: Int, val msg: String) extends Exception(msg)
12+
class ParseError(val idx: Int, val msg: String) extends Exception(msg, null, false, false)
1313

1414
/** Parse command line argument `s`, which has index `n`, as a value of type `T`
1515
* @throws ParseError if argument cannot be converted to type `T`.

Diff for: tests/printing/infix-operations.check

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ package <empty> {
3131
{
3232
case error @ _:scala.util.CommandLineParser.ParseError =>
3333
scala.util.CommandLineParser.showError(error)
34+
throw error
3435
}
3536
}
3637
}

0 commit comments

Comments
 (0)