diff options
author | Martin Odersky <odersky@gmail.com> | 2005-02-01 10:31:54 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2005-02-01 10:31:54 +0000 |
commit | 21204727d1c6abd841d9247013ddc5c93e2bee25 (patch) | |
tree | 94af3eb120da9762a871a68dbc37a64a014a8a18 | |
parent | 01a9d76f591b3be1091501bb8e1711b2b21b7bc8 (diff) | |
download | scala-21204727d1c6abd841d9247013ddc5c93e2bee25.tar.gz scala-21204727d1c6abd841d9247013ddc5c93e2bee25.tar.bz2 scala-21204727d1c6abd841d9247013ddc5c93e2bee25.zip |
*** empty log message ***
-rw-r--r-- | sources/scala/tools/scalac/typechecker/Analyzer.scala | 10 | ||||
-rw-r--r-- | sources/scala/tools/scalac/typechecker/Infer.scala | 4 | ||||
-rw-r--r-- | sources/scala/tools/util/Reporter.java | 3 |
3 files changed, 15 insertions, 2 deletions
diff --git a/sources/scala/tools/scalac/typechecker/Analyzer.scala b/sources/scala/tools/scalac/typechecker/Analyzer.scala index f22fd989bd..6c48cff25f 100644 --- a/sources/scala/tools/scalac/typechecker/Analyzer.scala +++ b/sources/scala/tools/scalac/typechecker/Analyzer.scala @@ -170,7 +170,12 @@ class Analyzer(global: scalac_Global, descr: AnalyzerPhase) extends Transformer( Name.fromString("<error: " + tree + ">"); private def errorTree(tree: Tree): Tree = - if (tree.isType()) errorTypeTree(tree) else errorTermTree(tree); + try { + if (tree.isType()) errorTypeTree(tree) else errorTermTree(tree); + } catch { + case ex: Type$Error => + Tree.Empty; + } private def errorTypeTree(tree: Tree): Tree = { val symbol = context.owner.newErrorClass(errorName(tree).toTypeName()); @@ -2726,8 +2731,9 @@ class Analyzer(global: scalac_Global, descr: AnalyzerPhase) extends Transformer( } i = i + 1; }} - if (matching1 >= 0 && matching2 < 0) + if (matching1 >= 0 && matching2 < 0) { fn1.setSymbol(alts(matching1)).setType(alttypes(matching1)); + } case _ => } diff --git a/sources/scala/tools/scalac/typechecker/Infer.scala b/sources/scala/tools/scalac/typechecker/Infer.scala index e5d3d433f1..0890e3ed52 100644 --- a/sources/scala/tools/scalac/typechecker/Infer.scala +++ b/sources/scala/tools/scalac/typechecker/Infer.scala @@ -1205,6 +1205,8 @@ class Infer(global: scalac_Global, gen: TreeGen, make: TreeFactory) extends scal } catch { case ex: NoInstance => false } + case Type.ErrorType => + true case _ => if (!regularValue) { val ftpe1 = applyType(ftpe); @@ -1245,6 +1247,8 @@ class Infer(global: scalac_Global, gen: TreeGen, make: TreeFactory) extends scal case _ => false } + case Type.ErrorType => + true case _ => false } diff --git a/sources/scala/tools/util/Reporter.java b/sources/scala/tools/util/Reporter.java index b2411e0649..b094f6b7de 100644 --- a/sources/scala/tools/util/Reporter.java +++ b/sources/scala/tools/util/Reporter.java @@ -59,4 +59,7 @@ public interface Reporter { public void error(Position position, String message); //######################################################################## + + /** Prints the number of errors and warnings if their are non-zero. */ + public void printSummary(); } |