aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-11-14 18:48:32 +0100
committerMartin Odersky <odersky@gmail.com>2013-11-14 18:48:32 +0100
commit157b9970ca99f2bbf080a96896a7c931d1c6ea1a (patch)
treeddbd216a72e1754fd03b9aafce3f979dc9045691
parentba87f4e2c5b911112e3f415e184c657241d47ad5 (diff)
downloaddotty-157b9970ca99f2bbf080a96896a7c931d1c6ea1a.tar.gz
dotty-157b9970ca99f2bbf080a96896a7c931d1c6ea1a.tar.bz2
dotty-157b9970ca99f2bbf080a96896a7c931d1c6ea1a.zip
making all internal errors throw exceptions (for now).
Better for now, since we do not want them do be hidden when testing / debugging the compiler.
-rw-r--r--src/dotty/tools/dotc/typer/Inferencing.scala2
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/typer/Inferencing.scala b/src/dotty/tools/dotc/typer/Inferencing.scala
index 50aa6c8d0..154fdcbd2 100644
--- a/src/dotty/tools/dotc/typer/Inferencing.scala
+++ b/src/dotty/tools/dotc/typer/Inferencing.scala
@@ -148,7 +148,7 @@ object Inferencing {
def fullyDefinedType(tp: Type, what: String, pos: Position)(implicit ctx: Context) =
if (isFullyDefined(tp, ForceDegree.all)) tp
- else errorType(i"internal error: type of $what $tp is not fully defined", pos)
+ else throw new Error(i"internal error: type of $what $tp is not fully defined, pos = $pos") // !!! DEBUG
private class IsFullyDefinedAccumulator(force: ForceDegree.Value)(implicit ctx: Context) extends TypeAccumulator[Boolean] {
def traverse(tp: Type): Boolean = apply(true, tp)
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index 5142f7360..1e84fad65 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -511,7 +511,7 @@ class Typer extends Namer with Applications with Implicits {
if (!mt.isDependent) mt.toFunctionType
else throw new Error(s"internal error: cannot turn dependent method type $mt into closure, position = ${tree.pos}") // !!! DEBUG. Eventually, convert to an error?
case tp =>
- errorType(i"internal error: closing over non-method $tp", tree.pos)
+ throw new Error(i"internal error: closing over non-method $tp, pos = ${tree.pos}")
}
cpy.Closure(tree, env1, meth1, EmptyTree).withType(ownType)
}