aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Typer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-09-30 10:07:41 +0200
committerMartin Odersky <odersky@gmail.com>2013-09-30 10:11:55 +0200
commite28dd856f6c0ccbd4094a73311a9c820f73913c4 (patch)
tree31acfaf5d391cb37db486c4bd585520bb228c165 /src/dotty/tools/dotc/typer/Typer.scala
parent968b608ea6f2d42d48f30e311d6008600dad27a8 (diff)
downloaddotty-e28dd856f6c0ccbd4094a73311a9c820f73913c4.tar.gz
dotty-e28dd856f6c0ccbd4094a73311a9c820f73913c4.tar.bz2
dotty-e28dd856f6c0ccbd4094a73311a9c820f73913c4.zip
Changed logic for merges in lub/glb
Now throws an exception for merge conflicts of types joint by |, a warning for types joint by &. Exception is handled as in the case of CyclicRefernce. Also: Added several typerState.checkConsistent for future debugging purposes.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Typer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index ba99ed0ca..224b3fcb1 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -851,9 +851,13 @@ class Typer extends Namer with Applications with Implicits {
}
def typed(tree: untpd.Tree, pt: Type = WildcardType)(implicit ctx: Context): Tree = ctx.traceIndented (s"typing ${tree.show}", show = true) {
- val tree1 = typedUnadapted(tree, pt)
- ctx.interpolateUndetVars(tree1.tpe.widen, tree1.pos)
- adapt(tree1, pt)
+ try {
+ val tree1 = typedUnadapted(tree, pt)
+ ctx.interpolateUndetVars(tree1.tpe.widen, tree1.pos)
+ adapt(tree1, pt)
+ } catch {
+ case ex: FatalTypeError => errorTree(tree, ex.getMessage)
+ }
}
def typedTrees(trees: List[untpd.Tree])(implicit ctx: Context): List[Tree] =