diff options
author | Martin Odersky <odersky@gmail.com> | 2013-09-26 15:33:42 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-09-26 15:33:42 +0200 |
commit | fcb68309c2760a6797b0a9ec23722808060e9aa1 (patch) | |
tree | fc0a9189baeb3991f3a7a67b98683cebeb8fd244 /src/dotty/tools/dotc/core/Types.scala | |
parent | 54acd26dcf377e2eb2a474399894e10cfd4322f5 (diff) | |
download | dotty-fcb68309c2760a6797b0a9ec23722808060e9aa1.tar.gz dotty-fcb68309c2760a6797b0a9ec23722808060e9aa1.tar.bz2 dotty-fcb68309c2760a6797b0a9ec23722808060e9aa1.zip |
Direct access to symbol in TermRef
If symbol was given explicitly, return it directly rather than going through denot.
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 3e419359b..ee76f0dc7 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -1233,7 +1233,11 @@ object Types { def isType = name.isTypeName def isTerm = name.isTermName - def symbol(implicit ctx: Context): Symbol = denot.symbol + def symbol(implicit ctx: Context): Symbol = lastDenotationOrSym match { + case sym: Symbol => sym + case _ => denot.symbol + } + def info(implicit ctx: Context): Type = denot.info override def underlying(implicit ctx: Context): Type = info |