summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-03-04 05:22:57 +0000
committerPaul Phillips <paulp@improving.org>2010-03-04 05:22:57 +0000
commit34b8e8fcbbb1b11ce81bf69b730abcb78b6699ec (patch)
treeb2ae69f2731acde0ec4b921cf2e1a73295ea3250 /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parent65520ac86f5362bfa438c0b9e1a84f1f558e2618 (diff)
downloadscala-34b8e8fcbbb1b11ce81bf69b730abcb78b6699ec.tar.gz
scala-34b8e8fcbbb1b11ce81bf69b730abcb78b6699ec.tar.bz2
scala-34b8e8fcbbb1b11ce81bf69b730abcb78b6699ec.zip
A few yards short of the goal posts attempt at ...
A few yards short of the goal posts attempt at making our usage of Throwable subclasses more consistent. This patch eliminates a lot of ad hoc Exception/Error/etc. creation and various arbitrary choices are rendered slightly less arbitrary. From now on let's try not to use the word "Exception" or "Error" in the names of Throwable subclasses unless they actually derive (and make sense to derive) from Exception or Error. Review by community.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index f557cf7b10..a41dcc24f7 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -12,7 +12,7 @@ package scala.tools.nsc
package typechecker
import scala.collection.mutable.{HashMap, ListBuffer}
-import scala.util.control.ControlException
+import scala.util.control.ControlThrowable
import scala.tools.nsc.interactive.RangePositions
import scala.tools.nsc.util.{Set, SourceFile, BatchSourceFile}
import symtab.Flags._
@@ -4082,7 +4082,7 @@ trait Typers { self: Analyzer =>
assert(onlyPresentation) // should not happen in normal circumstances.
tree setType tree.symbol.tpe
case _ =>
- throw new Error("unexpected tree: " + tree.getClass + "\n" + tree)//debug
+ abort("unexpected tree: " + tree.getClass + "\n" + tree)//debug
}
}
@@ -4133,7 +4133,6 @@ trait Typers { self: Analyzer =>
if (phase.id <= currentRun.typerPhase.id) signalDone(context.asInstanceOf[analyzer.Context], tree, result)
result
} catch {
- case ex: ControlException => throw ex
case ex: TypeError =>
tree.tpe = null
if (printTypings) println("caught "+ex+" in typed: "+tree);//DEBUG
@@ -4145,13 +4144,9 @@ trait Typers { self: Analyzer =>
if ((context ne null) && (context.unit ne null) &&
(context.unit.source ne null) && (tree ne null))
logError("AT: " + (tree.pos).dbgString, ex);
- throw(ex)
-/*
- case ex: java.lang.Error =>
- Console.println("exception when typing "+tree+", pt = "+pt)
throw ex
-*/ //debug
- } finally {
+ }
+ finally {
if (Statistics.enabled) {
val t = currentTime()
microsByType(pendingTreeTypes.head) += ((t - typerTime) / 1000).toInt