We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fdb3540 commit 1d512a7Copy full SHA for 1d512a7
src/dotty/tools/dotc/Driver.scala
@@ -50,8 +50,13 @@ abstract class Driver extends DotClass {
50
process(args, initCtx)
51
}
52
53
- def main(args: Array[String]): Unit =
+ def main(args: Array[String]): Unit = {
54
+ // Preload scala.util.control.NonFatal. Otherwise, when trying to catch a StackOverflowError,
55
+ // we may try to load it but fail with another StackOverflowError and lose the original exception,
56
+ // see <https://groups.google.com/forum/#!topic/scala-user/kte6nak-zPM>.
57
+ val _ = NonFatal
58
sys.exit(if (process(args).hasErrors) 1 else 0)
59
+ }
60
61
62
class FatalError(msg: String) extends Exception
0 commit comments