summaryrefslogtreecommitdiff
path: root/src/compiler/scala/reflect/internal/Symbols.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-10-19 20:23:13 +0000
committerPaul Phillips <paulp@improving.org>2011-10-19 20:23:13 +0000
commit8337964e312849e5a904b3cfbfa1def0cf180a05 (patch)
treee28a8b04bfff6b3112a67871a70623ae9ed81a15 /src/compiler/scala/reflect/internal/Symbols.scala
parent8fc7a72a2b7765b6f5c6c5feb2bcaae58e735396 (diff)
downloadscala-8337964e312849e5a904b3cfbfa1def0cf180a05.tar.gz
scala-8337964e312849e5a904b3cfbfa1def0cf180a05.tar.bz2
scala-8337964e312849e5a904b3cfbfa1def0cf180a05.zip
Overhaul of mixin.
If extempore is going to fix the hard bugs then first he is going to make them less hard to fix. The major work of interest in here is the decomplification of the bitmap logic. Hopefully this will come in handy for anyone wishing to try out other encodings.
Diffstat (limited to 'src/compiler/scala/reflect/internal/Symbols.scala')
-rw-r--r--src/compiler/scala/reflect/internal/Symbols.scala14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/compiler/scala/reflect/internal/Symbols.scala b/src/compiler/scala/reflect/internal/Symbols.scala
index 81c718e65c..8175040a76 100644
--- a/src/compiler/scala/reflect/internal/Symbols.scala
+++ b/src/compiler/scala/reflect/internal/Symbols.scala
@@ -1317,8 +1317,8 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
/** The symbol accessed by this accessor function, but with given owner type. */
final def accessed(ownerTp: Type): Symbol = {
- assert(hasAccessorFlag)
- ownerTp.decl(nme.getterToLocal(if (isSetter) nme.setterToGetter(name) else name))
+ assert(hasAccessorFlag, this)
+ ownerTp decl nme.getterToLocal(getterName)
}
/** The module corresponding to this module class (note that this
@@ -1349,6 +1349,9 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
/** If this is a lazy value, the lazy accessor; otherwise this symbol. */
def lazyAccessorOrSelf: Symbol = if (isLazy) lazyAccessor else this
+ /** If this is an accessor, the accessed symbol. Otherwise, this symbol. */
+ def accessedOrSelf: Symbol = if (hasAccessorFlag) accessed else this
+
/** For an outer accessor: The class from which the outer originates.
* For all other symbols: NoSymbol
*/
@@ -1646,10 +1649,9 @@ trait Symbols extends api.Symbols { self: SymbolTable =>
/** The getter of this value or setter definition in class `base`, or NoSymbol if
* none exists.
*/
- final def getter(base: Symbol): Symbol = {
- val getterName = if (isSetter) nme.setterToGetter(name) else nme.getterName(name)
- base.info.decl(getterName) filter (_.hasAccessorFlag)
- }
+ final def getter(base: Symbol): Symbol = base.info.decl(getterName) filter (_.hasAccessorFlag)
+
+ def getterName = if (isSetter) nme.setterToGetter(name) else nme.getterName(name)
/** The setter of this value or getter definition, or NoSymbol if none exists */
final def setter(base: Symbol): Symbol = setter(base, false)