diff options
author | Martin Odersky <odersky@gmail.com> | 2015-05-07 11:34:47 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-05-07 11:34:47 +0200 |
commit | 7481babc3c5d72b2f86fdb50c043a608ad4f8dc0 (patch) | |
tree | 1476bae4a348e33ccf2287c95e0dacab3054e8b3 /src/dotty | |
parent | 8f020bb6632d5d68e169f8caa7d9cbc1bc819d35 (diff) | |
download | dotty-7481babc3c5d72b2f86fdb50c043a608ad4f8dc0.tar.gz dotty-7481babc3c5d72b2f86fdb50c043a608ad4f8dc0.tar.bz2 dotty-7481babc3c5d72b2f86fdb50c043a608ad4f8dc0.zip |
Make isTerm/isType not force the denotation of a symbol to be up-to-date.
Symbols never change betwene terms and types. So we do not need to the current
denotation to decide what they are. Less forcing -> less potential for cyclic
references.
Diffstat (limited to 'src/dotty')
-rw-r--r-- | src/dotty/tools/dotc/core/Symbols.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/Symbols.scala b/src/dotty/tools/dotc/core/Symbols.scala index 94ac258da..f7d74d73e 100644 --- a/src/dotty/tools/dotc/core/Symbols.scala +++ b/src/dotty/tools/dotc/core/Symbols.scala @@ -406,8 +406,8 @@ object Symbols { } /** Subclass tests and casts */ - final def isTerm(implicit ctx: Context): Boolean = denot.isTerm - final def isType(implicit ctx: Context): Boolean = denot.isType + final def isTerm(implicit ctx: Context): Boolean = lastDenot.isTerm + final def isType(implicit ctx: Context): Boolean = lastDenot.isType final def isClass: Boolean = isInstanceOf[ClassSymbol] final def asTerm(implicit ctx: Context): TermSymbol = { assert(isTerm, s"asTerm called on not-a-Term $this" ); asInstanceOf[TermSymbol] } |