diff options
author | Paul Phillips <paulp@improving.org> | 2012-03-02 20:07:25 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-03-02 20:13:23 -0800 |
commit | d852612c3537f2e4506dd838c719d44a3031679d (patch) | |
tree | a56afe52a9a86f50e6fe0f83d225364997527f87 /src | |
parent | 43532f1192f1cf71989f7e78b7ee277b03806643 (diff) | |
download | scala-d852612c3537f2e4506dd838c719d44a3031679d.tar.gz scala-d852612c3537f2e4506dd838c719d44a3031679d.tar.bz2 scala-d852612c3537f2e4506dd838c719d44a3031679d.zip |
Fix for corner case in type printing.
Closes SI-5537.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/reflect/internal/Types.scala | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/compiler/scala/reflect/internal/Types.scala b/src/compiler/scala/reflect/internal/Types.scala index ed1631fae5..0a9449226b 100644 --- a/src/compiler/scala/reflect/internal/Types.scala +++ b/src/compiler/scala/reflect/internal/Types.scala @@ -1118,7 +1118,14 @@ trait Types extends api.Types { self: SymbolTable => underlying.baseTypeSeq prepend this } override def isHigherKinded = false // singleton type classifies objects, thus must be kind * - override def safeToString: String = prefixString + "type" + override def safeToString: String = { + // Avoiding printing Predef.type and scala.package.type as "type", + // since in all other cases we omit those prefixes. + val pre = underlying.typeSymbol.skipPackageObject + if (pre.isOmittablePrefix) pre.fullName + ".type" + else prefixString + "type" + } + /* override def typeOfThis: Type = typeSymbol.typeOfThis override def bounds: TypeBounds = TypeBounds(this, this) |