From 5ec4e3db6e48f8c36dff67ba262a8b41647cef5c Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 7 Feb 2013 13:52:09 +0100 Subject: Make typeConstructors of package classes symbolic. Reason (1): The previous scheme would have failed for RootClass. (2) Symbols of package classes do not change between compilation runs, so the new scheme is more efficient. --- src/dotty/tools/dotc/core/SymDenotations.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/dotty/tools/dotc') diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index df768cf61..61b240586 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -441,11 +441,12 @@ object SymDenotations { /** The type This(cls), where cls is this class, NoPrefix for all other symbols */ def thisType(implicit ctx: Context): Type = NoPrefix - /** The type representing the type constructor for this type, + /** The type representing the type constructor for this type. * @throws ClassCastException is this is not a type */ def typeConstructor(implicit ctx: Context): TypeRef = - TypeRef(owner.thisType, name.asTypeName) + if (isPackageClass) TypeRef(owner.thisType, symbol.asType) + else TypeRef(owner.thisType, name.asTypeName) /** The variance of this type parameter as an Int, with * +1 = Covariant, -1 = Contravariant, 0 = Nonvariant, or not a type parameter -- cgit v1.2.3