diff options
author | Martin Odersky <odersky@gmail.com> | 2013-09-16 17:56:17 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-09-16 17:56:17 +0200 |
commit | dba4f1ec3dc5f489056284aab63c771cdd32561c (patch) | |
tree | ab6af09b871c2a01741fd5bbe874a1e19a3fddea /src/dotty/tools/dotc/ast | |
parent | 682cf32cbe5cebeccf9ea10caf43e74c9cecc7c0 (diff) | |
download | dotty-dba4f1ec3dc5f489056284aab63c771cdd32561c.tar.gz dotty-dba4f1ec3dc5f489056284aab63c771cdd32561c.tar.bz2 dotty-dba4f1ec3dc5f489056284aab63c771cdd32561c.zip |
Bug fixes and improvements in error diagnostics.
Main refactoring: lub/glb moves to type comparers.
Diffstat (limited to 'src/dotty/tools/dotc/ast')
-rw-r--r-- | src/dotty/tools/dotc/ast/TypedTrees.scala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/dotty/tools/dotc/ast/TypedTrees.scala b/src/dotty/tools/dotc/ast/TypedTrees.scala index a34e015b8..a126108aa 100644 --- a/src/dotty/tools/dotc/ast/TypedTrees.scala +++ b/src/dotty/tools/dotc/ast/TypedTrees.scala @@ -32,7 +32,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo { def Super(qual: Tree, mix: TypeName)(implicit ctx: Context): Super = { val owntype = - if (mix.isEmpty) ctx.glb(qual.tpe.parents) + if (mix.isEmpty) ctx.typeComparer.glb(qual.tpe.parents) else { val mixParents = qual.tpe.parents filter (_.name == mix) check(mixParents.length == 1) @@ -132,7 +132,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo { } def Match(selector: Tree, cases: List[CaseDef])(implicit ctx: Context): Match = - untpd.Match(selector, cases).withType(ctx.lub(cases.tpes)).checked + untpd.Match(selector, cases).withType(ctx.typeComparer.lub(cases.tpes)).checked def CaseDef(pat: Tree, guard: Tree, body: Tree)(implicit ctx: Context): CaseDef = untpd.CaseDef(pat, guard, body).withType(body.tpe).checked @@ -148,7 +148,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo { def SeqLiteral(elems: List[Tree])(implicit ctx: Context): SeqLiteral = untpd.SeqLiteral(elems) - .withType(defn.SeqClass.typeConstructor.appliedTo(ctx.lub(elems.tpes))) + .withType(defn.SeqClass.typeConstructor.appliedTo(ctx.typeComparer.lub(elems.tpes))) .checked def SeqLiteral(tpe: Type, elems: List[Tree])(implicit ctx: Context): SeqLiteral = { @@ -160,7 +160,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo { def JavaSeqLiteral(elems: List[Tree])(implicit ctx: Context): SeqLiteral = new untpd.JavaSeqLiteral(elems) - .withType(defn.ArrayClass.typeConstructor.appliedTo(ctx.lub(elems.tpes))) + .withType(defn.ArrayClass.typeConstructor.appliedTo(ctx.typeComparer.lub(elems.tpes))) .checked def TypeTree(original: Tree)(implicit ctx: Context): TypeTree = @@ -204,7 +204,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo { untpd.Bind(sym.name, body).withType(refType(sym)).checked def Alternative(trees: List[Tree])(implicit ctx: Context): Alternative = - untpd.Alternative(trees).withType(ctx.lub(trees map (_.tpe))).checked + untpd.Alternative(trees).withType(ctx.typeComparer.lub(trees map (_.tpe))).checked def UnApply(fun: Tree, args: List[Tree])(implicit ctx: Context): UnApply = { val owntype = fun.tpe.widen match { |