aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-05-26 08:51:14 +0200
committerMartin Odersky <odersky@gmail.com>2016-07-11 13:34:58 +0200
commit5d0318681f8c368f04796da5dd11ee1c9fcbdbd0 (patch)
tree395fc2f288c70655356e8c8da054f78da1c9bdef /src/dotty/tools/dotc/core/Types.scala
parentd30f441ae986c144e739223be97b906b3bbd43dc (diff)
downloaddotty-5d0318681f8c368f04796da5dd11ee1c9fcbdbd0.tar.gz
dotty-5d0318681f8c368f04796da5dd11ee1c9fcbdbd0.tar.bz2
dotty-5d0318681f8c368f04796da5dd11ee1c9fcbdbd0.zip
Better printing of skolems
They not print similar to scalac: "?x" where `x` is a unique number. Todo: An offline explanation what they are, similar to javac. I.e. ... ?3 ... where ?3: T
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r--src/dotty/tools/dotc/core/Types.scala7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index b26fd6373..8eae84a51 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -2596,6 +2596,13 @@ object Types {
if (info eq this.info) this else SkolemType(info)
override def hashCode: Int = identityHash
override def equals(that: Any) = this eq that.asInstanceOf[AnyRef]
+
+ private var myRepr: String = null
+ def repr(implicit ctx: Context) = {
+ if (myRepr == null) myRepr = ctx.freshName("?")
+ myRepr
+ }
+
override def toString = s"Skolem($info)"
}