diff options
author | Paul Phillips <paulp@improving.org> | 2013-03-25 11:03:25 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-03-25 11:03:25 -0700 |
commit | 98daf03a902e9af902870448f9de17ff140d9bca (patch) | |
tree | 34557b2cc0f7aba376a38e2ee5d76ddd4e55f2d9 /src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala | |
parent | 1187c9896c097e6e591e5655b35f52c06b3c900a (diff) | |
download | scala-98daf03a902e9af902870448f9de17ff140d9bca.tar.gz scala-98daf03a902e9af902870448f9de17ff140d9bca.tar.bz2 scala-98daf03a902e9af902870448f9de17ff140d9bca.zip |
Overhauled local/getter/setter name logic.
Sifted through extraneous methods trying to find consistency,
consolidating and deprecating as I went. The original motivation
for all this was the restoration of LOCAL_SUFFIX to originalName,
because:
It looks like in an attempt to make originalName print
consistently with decodedName, I went a little too far and
stripped invisible trailing spaces from originalName. This
meant outer fields would have an originalName of '$outer'
instead of '$outer ', which in turn could have caused them to
be mis-recognized as outer accessors, because the logic of
outerSource hinges upon "originalName == nme.OUTER".
I don't know if this affected anything - I noticed it by
inspection, improbably enough.
Deprecated originalName - original, compared to what? - in
favor of unexpandedName, which has a more obvious complement.
Introduced string_== for the many spots where people have
given up and are comparing string representations of names.
A light dusting of types is still better than nothing.
Editoral note: LOCAL_SUFFIX is the worst. Significant trailing
whitespace! It's a time bomb.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala b/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala index c967fed0b9..fb692a1954 100644 --- a/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala +++ b/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala @@ -388,7 +388,7 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT assert(clazz != NoSymbol, sym) debuglog("Decided for host class: " + clazz) - val accName = nme.protName(sym.originalName) + val accName = nme.protName(sym.unexpandedName) val hasArgs = sym.tpe.paramSectionCount > 0 val memberType = refChecks.toScalaRepeatedParam(sym.tpe) // fix for #2413 @@ -406,7 +406,7 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT } val protAcc = clazz.info.decl(accName).suchThat(s => s == NoSymbol || s.tpe =:= accType(s)) orElse { - val newAcc = clazz.newMethod(nme.protName(sym.originalName), tree.pos, newFlags = ARTIFACT) + val newAcc = clazz.newMethod(nme.protName(sym.unexpandedName), tree.pos, newFlags = ARTIFACT) newAcc setInfoAndEnter accType(newAcc) val code = DefDef(newAcc, { @@ -466,7 +466,7 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT assert(clazz != NoSymbol, field) debuglog("Decided for host class: " + clazz) - val accName = nme.protSetterName(field.originalName) + val accName = nme.protSetterName(field.unexpandedName) val protectedAccessor = clazz.info decl accName orElse { val protAcc = clazz.newMethod(accName, field.pos, newFlags = ARTIFACT) val paramTypes = List(clazz.typeOfThis, field.tpe) |