diff options
author | Martin Odersky <odersky@gmail.com> | 2015-06-28 19:26:21 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-07-06 16:55:51 +0200 |
commit | 1061743aaaf2b18419c8fdb1cc89cb1498c9673f (patch) | |
tree | f2a2c4ab7afc7fa7a534ab84543e22e8e465098d /src/dotty/tools/dotc/typer/Typer.scala | |
parent | c277b9865b8a9a0f72279e0a33184ec3a4efcc33 (diff) | |
download | dotty-1061743aaaf2b18419c8fdb1cc89cb1498c9673f.tar.gz dotty-1061743aaaf2b18419c8fdb1cc89cb1498c9673f.tar.bz2 dotty-1061743aaaf2b18419c8fdb1cc89cb1498c9673f.zip |
Error instead of crash when sigName comes up with a missing reference.
A TypeRef can have be unresolved, either because it refers to something that's missing
from the classpath or because of transitive self type references. Instead of crashing
in sigName, we now report the error.
Achieved by defining a new exception type, MissingType, which derives from TypeError.
This catches t7933.scala, now integrated in the neg/selfreq.scala. The problem there was
a reference to AbsSettings, which was not a member of StandardScalaSettings.this,
but was a member of the required type of AbsSettings, which itself appeared in the
required type of StandardScalaSettings. We will outlaw in the next commit such transitive
required references.
Also collapsed TypeError and FatalTypeError. It was a misnomer anyway. Fatal were those
type errors that were caught and reported!
Open: Where else we should check for unresolved NamedTypes.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index 479eedd38..33ec156a1 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -1087,7 +1087,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit try adapt(typedUnadapted(tree, pt), pt, tree) catch { case ex: CyclicReference => errorTree(tree, cyclicErrorMsg(ex)) - case ex: FatalTypeError => errorTree(tree, ex.getMessage) + case ex: TypeError => errorTree(tree, ex.getMessage) } } |