diff options
author | Martin Odersky <odersky@gmail.com> | 2013-04-03 19:02:42 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-04-03 19:02:42 +0200 |
commit | 609aeee025eec0bfc6680bf7fe717d0083cfb15b (patch) | |
tree | 285e0ed9fe11ddacac7277cf928b62ff48ce677f /src/dotty/tools/dotc/core/Types.scala | |
parent | df79c5efc7190e7a61ce7ac526aca0aac520ea9f (diff) | |
download | dotty-609aeee025eec0bfc6680bf7fe717d0083cfb15b.tar.gz dotty-609aeee025eec0bfc6680bf7fe717d0083cfb15b.tar.bz2 dotty-609aeee025eec0bfc6680bf7fe717d0083cfb15b.zip |
Improvements in tracing and some Type fixes.
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 10 |
1 files changed, 6 insertions, 4 deletions
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 |