diff options
author | Martin Odersky <odersky@gmail.com> | 2013-02-06 21:37:01 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-02-06 21:37:01 +0100 |
commit | 401fae7d1ccd6bcd523dccd28f2e29090eaec1ef (patch) | |
tree | c3fe8453ee1c1fb526f89e05d4f7881726da5594 /src/dotty/tools/dotc/core/Symbols.scala | |
parent | 831abc1fd1bbebfdfdec1a5693cbfc0bac613c62 (diff) | |
download | dotty-401fae7d1ccd6bcd523dccd28f2e29090eaec1ef.tar.gz dotty-401fae7d1ccd6bcd523dccd28f2e29090eaec1ef.tar.bz2 dotty-401fae7d1ccd6bcd523dccd28f2e29090eaec1ef.zip |
Some progress in printing things.
Diffstat (limited to 'src/dotty/tools/dotc/core/Symbols.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Symbols.scala | 11 |
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 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) |