From 609aeee025eec0bfc6680bf7fe717d0083cfb15b Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 3 Apr 2013 19:02:42 +0200 Subject: Improvements in tracing and some Type fixes. --- src/dotty/tools/dotc/core/Types.scala | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/dotty/tools/dotc/core/Types.scala') diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index c1a84604f..98dcc43a1 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -462,7 +462,8 @@ object Types { /** This type seen as a TypeBounds */ final def bounds(implicit ctx: Context): TypeBounds = this match { case tp: TypeBounds => tp - case _ => TypeBounds(this, this) + case ci: ClassInfo => TypeAlias(ci.typeConstructor) + case _ => TypeAlias(this) } /** The type parameter with given `name`. This tries first `preCompleteDecls` @@ -1406,7 +1407,8 @@ object Types { else tp.substThis(cls, prefix) def typeConstructor(implicit ctx: Context): Type = - NamedType(prefix, cls.name) + if ((cls is PackageClass) || cls.owner.isTerm) TypeRef(prefix, cls) + else TypeRef(prefix, cls.name) // cached because baseType needs parents private var parentsCache: List[TypeRef] = null @@ -1435,8 +1437,8 @@ object Types { /** Type bounds >: lo <: hi */ abstract case class TypeBounds(lo: Type, hi: Type) extends CachedProxyType with TypeType { - assert(!lo.isInstanceOf[TypeBounds], lo+" "+lo.getClass) - assert(!hi.isInstanceOf[TypeBounds], hi+" "+hi.getClass) + assert(lo.isInstanceOf[TermType], lo+" "+lo.getClass) + assert(hi.isInstanceOf[TermType], hi+" "+hi.getClass) override def underlying(implicit ctx: Context): Type = hi -- cgit v1.2.3