diff options
author | Martin Odersky <odersky@gmail.com> | 2014-07-21 18:50:15 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-08-03 17:28:33 +0200 |
commit | 3065790f8536f8a6c088d6c6115f71ce45ca5ae0 (patch) | |
tree | 17c65e88bfa367d8f895bfb55a53ddb07eb575e7 /src/dotty/tools/dotc/core/SymDenotations.scala | |
parent | 9d90361eeb76f3b090a96033e20ed1a272c3493c (diff) | |
download | dotty-3065790f8536f8a6c088d6c6115f71ce45ca5ae0.tar.gz dotty-3065790f8536f8a6c088d6c6115f71ce45ca5ae0.tar.bz2 dotty-3065790f8536f8a6c088d6c6115f71ce45ca5ae0.zip |
Added utility method: underlyingSymbol
Diffstat (limited to 'src/dotty/tools/dotc/core/SymDenotations.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index 00c3d7666..61c700760 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -598,6 +598,13 @@ object SymDenotations { field orElse getter } + /** The field accessed by a getter or setter, or + * if it does not exists, the getter of a setter, or + * if that does not exist the symbol itself. + */ + def underlyingSymbol(implicit ctx: Context): Symbol = + if (is(Accessor)) accessedFieldOrGetter orElse symbol else symbol + /** The chain of owners of this denotation, starting with the denoting symbol itself */ final def ownersIterator(implicit ctx: Context) = new Iterator[Symbol] { private[this] var current = symbol |