diff options
author | Martin Odersky <odersky@gmail.com> | 2014-10-11 14:10:46 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-10-12 10:52:17 +0200 |
commit | ce826ee7dd9beed775a614549b412df68f13fcac (patch) | |
tree | c8efdc8dd3da780bf01b02044552698b91d3911c | |
parent | 3c6cf3936228fc317b90ffca8b5d9dda2883e508 (diff) | |
download | dotty-ce826ee7dd9beed775a614549b412df68f13fcac.tar.gz dotty-ce826ee7dd9beed775a614549b412df68f13fcac.tar.bz2 dotty-ce826ee7dd9beed775a614549b412df68f13fcac.zip |
Avoid generating Any in erasedLubs
... because Any is not an erasedType (this is now checked)
-rw-r--r-- | src/dotty/tools/dotc/TypeErasure.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/TypeErasure.scala b/src/dotty/tools/dotc/TypeErasure.scala index 9b0d73e88..50aaafc82 100644 --- a/src/dotty/tools/dotc/TypeErasure.scala +++ b/src/dotty/tools/dotc/TypeErasure.scala @@ -31,7 +31,7 @@ object TypeErasure { */ def isErasedType(tp: Type)(implicit ctx: Context): Boolean = tp match { case tp: TypeRef => - tp.symbol.isClass + tp.symbol.isClass && tp.symbol != defn.AnyClass case _: TermRef => true case JavaArrayType(elem) => @@ -168,7 +168,7 @@ object TypeErasure { def loop(bcs: List[ClassSymbol], bestSoFar: ClassSymbol): ClassSymbol = bcs match { case bc :: bcs1 => if (cls2.derivesFrom(bc)) - if (!bc.is(Trait)) bc + if (!bc.is(Trait) && bc != defn.AnyClass) bc else loop(bcs1, if (bestSoFar.derivesFrom(bc)) bestSoFar else bc) else loop(bcs1, bestSoFar) |