diff options
author | Martin Odersky <odersky@gmail.com> | 2014-12-14 19:15:18 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-12-15 16:36:53 +0100 |
commit | 332b1af33441b382b3e1efa68c5dab4fcda8b2bc (patch) | |
tree | b04a52702b09d8423fc053f88e1883940e27b600 /src/dotty/tools/dotc/typer/ReTyper.scala | |
parent | 0eec180a686a4425bd3f3089006eda530123fe2e (diff) | |
download | dotty-332b1af33441b382b3e1efa68c5dab4fcda8b2bc.tar.gz dotty-332b1af33441b382b3e1efa68c5dab4fcda8b2bc.tar.bz2 dotty-332b1af33441b382b3e1efa68c5dab4fcda8b2bc.zip |
Replace Throwable catches with NonFatal
Previously, stackoverflows led to infinite loops because the catch
immediately threw another stack overflow. Anyway, one should never
catch Throwable.
Diffstat (limited to 'src/dotty/tools/dotc/typer/ReTyper.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/ReTyper.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/ReTyper.scala b/src/dotty/tools/dotc/typer/ReTyper.scala index a2d4ebad8..901542f21 100644 --- a/src/dotty/tools/dotc/typer/ReTyper.scala +++ b/src/dotty/tools/dotc/typer/ReTyper.scala @@ -9,6 +9,7 @@ import Decorators._ import typer.ProtoTypes._ import ast.{tpd, untpd} import ast.Trees._ +import scala.util.control.NonFatal /** A version of Typer that keeps all symbols defined and referenced in a * previously typed tree. @@ -91,7 +92,7 @@ class ReTyper extends Typer { override def typedUnadapted(tree: untpd.Tree, pt: Type)(implicit ctx: Context) = try super.typedUnadapted(tree, pt) catch { - case ex: Throwable => + case NonFatal(ex) => println(i"exception while typing $tree of class ${tree.getClass} # ${tree.uniqueId}") throw ex } |