diff options
author | Martin Odersky <odersky@gmail.com> | 2013-02-07 13:52:09 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-02-07 13:52:09 +0100 |
commit | 5ec4e3db6e48f8c36dff67ba262a8b41647cef5c (patch) | |
tree | 57b3a59368d8893c48c353d41838e71d3cb65cd1 | |
parent | 11a3d0d2792689d4992bef6dd0887dd5e8a08cb5 (diff) | |
download | dotty-5ec4e3db6e48f8c36dff67ba262a8b41647cef5c.tar.gz dotty-5ec4e3db6e48f8c36dff67ba262a8b41647cef5c.tar.bz2 dotty-5ec4e3db6e48f8c36dff67ba262a8b41647cef5c.zip |
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.
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 5 |
1 files changed, 3 insertions, 2 deletions
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 |