diff options
author | Martin Odersky <odersky@gmail.com> | 2014-07-01 14:43:18 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-07-17 11:01:59 +0200 |
commit | 3ab2784948d084557e88cd7eb5c55a29613742d0 (patch) | |
tree | 62ce5b62fc08afc070e9e705687e9fa05a6e1947 /src/dotty/tools/dotc/core/NameOps.scala | |
parent | 8112a39d3a00f53a68af794d0a83cf995faf31e2 (diff) | |
download | dotty-3ab2784948d084557e88cd7eb5c55a29613742d0.tar.gz dotty-3ab2784948d084557e88cd7eb5c55a29613742d0.tar.bz2 dotty-3ab2784948d084557e88cd7eb5c55a29613742d0.zip |
Added phase: SuperAccessors
Rewrote SuperAccessors (more to be done; see comments), and
added stuff here and there to make it work smoother.
Diffstat (limited to 'src/dotty/tools/dotc/core/NameOps.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/NameOps.scala | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/NameOps.scala b/src/dotty/tools/dotc/core/NameOps.scala index 7c10bfd4d..404a0844a 100644 --- a/src/dotty/tools/dotc/core/NameOps.scala +++ b/src/dotty/tools/dotc/core/NameOps.scala @@ -132,6 +132,9 @@ object NameOps { if (flags is (ModuleClass, butNot = Package)) name.asTypeName.moduleClassName.asInstanceOf[N] else name + /** The superaccessor for method with given name */ + def superName: TermName = (nme.SUPER_PREFIX ++ name).toTermName + /** The expanded name of `name` relative to this class `base` with given `separator` */ def expandedName(base: Symbol, separator: Name = nme.EXPAND_SEPARATOR)(implicit ctx: Context): N = { @@ -255,11 +258,11 @@ object NameOps { /** The name of an accessor for protected symbols. */ def protectedAccessorName: TermName = - PROTECTED_PREFIX ++ name + PROTECTED_PREFIX ++ name.unexpandedName() /** The name of a setter for protected symbols. Used for inherited Java fields. */ - def protectedSetterName(name: Name): TermName = - PROTECTED_SET_PREFIX ++ name + def protectedSetterName: TermName = + PROTECTED_SET_PREFIX ++ name.unexpandedName() def moduleVarName: TermName = name ++ MODULE_VAR_SUFFIX |