aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Symbols.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-03-17 20:12:16 +0100
committerMartin Odersky <odersky@gmail.com>2013-03-17 20:12:16 +0100
commit52d740d120cd197ee816aa0a06732ccdb5d5ab29 (patch)
tree6c6e7120ff879f72e8f7fa95b72ea5b7cdbe321c /src/dotty/tools/dotc/core/Symbols.scala
parent1d029f5f8f90a909ed140f7ef5cf656fafd9fc27 (diff)
downloaddotty-52d740d120cd197ee816aa0a06732ccdb5d5ab29.tar.gz
dotty-52d740d120cd197ee816aa0a06732ccdb5d5ab29.tar.bz2
dotty-52d740d120cd197ee816aa0a06732ccdb5d5ab29.zip
Added emulation of higher-kinded types.
Also improvements to toString.
Diffstat (limited to 'src/dotty/tools/dotc/core/Symbols.scala')
-rw-r--r--src/dotty/tools/dotc/core/Symbols.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/Symbols.scala b/src/dotty/tools/dotc/core/Symbols.scala
index e76de6bdf..089d41be7 100644
--- a/src/dotty/tools/dotc/core/Symbols.scala
+++ b/src/dotty/tools/dotc/core/Symbols.scala
@@ -229,6 +229,8 @@ trait Symbols { this: Context =>
tparams
}
+ def newSkolem(tp: Type) = newSymbol(defn.RootClass, nme.SKOLEM, SyntheticArtifact, tp)
+
type OwnerMap = Symbol => Symbol
/** Map given symbols, subjecting all types to given type map and owner map.
@@ -367,6 +369,13 @@ object Symbols {
private def pickFile(file: AbstractFile, classFile: Boolean): AbstractFile =
if ((file eq null) || classFile != (file.path endsWith ".class")) null else file
+ /** The prefix string to be used when displaying this symbol without denotation */
+ protected def prefixString = "Symbol"
+
+ override def toString: String =
+ if (lastDenot == null) s"Naked$prefixString#$id"
+ else lastDenot.toString
+
def show(implicit ctx: Context): String = ctx.show(this)
def showLocated(implicit ctx: Context): String = ctx.showLocated(this)
def showDcl(implicit ctx: Context): String = ctx.showDcl(this)
@@ -415,6 +424,8 @@ object Symbols {
/** Have we seen a subclass of this class? */
def hasChildren = superIdHint >= 0
+
+ override protected def prefixString = "ClassSymbol"
}
class ErrorSymbol(val underlying: Symbol, msg: => String)(implicit ctx: Context) extends Symbol(NoCoord) {