From 401fae7d1ccd6bcd523dccd28f2e29090eaec1ef Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 6 Feb 2013 21:37:01 +0100 Subject: Some progress in printing things. --- src/dotty/tools/dotc/core/Symbols.scala | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/dotty/tools/dotc/core/Symbols.scala') diff --git a/src/dotty/tools/dotc/core/Symbols.scala b/src/dotty/tools/dotc/core/Symbols.scala index 5f60922ee..6c267da62 100644 --- a/src/dotty/tools/dotc/core/Symbols.scala +++ b/src/dotty/tools/dotc/core/Symbols.scala @@ -145,6 +145,14 @@ object Symbols { denot } + private[this] var _id: Int = _ + + /** The unique id of this symbol */ + def id(implicit ctx: Context) = { + if (_id == 0) _id = ctx.nextId + _id + } + /** Subclass tests and casts */ final def isTerm: Boolean = isInstanceOf[TermSymbol] final def isType: Boolean = isInstanceOf[TypeSymbol] @@ -201,6 +209,9 @@ object Symbols { /** The current annotations of this symbol */ final def annotations(implicit ctx: Context): List[Annotation] = denot.annotations + /** The name with which this symbol was created */ + def originalName(implicit ctx: Context) = denot.originalName + /** Set given flags(s) of this symbol */ def setFlag(flags: FlagSet)(implicit ctx: Context): Unit = denot.setFlag(flags) -- cgit v1.2.3