diff options
author | Paul Phillips <paulp@improving.org> | 2010-11-02 16:49:45 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-11-02 16:49:45 +0000 |
commit | 8e320487627e85cce44a4eab0d77d28fd0904d50 (patch) | |
tree | 4ec432f0c3566e5b4d70aebe1bc9266cf006efd0 /src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala | |
parent | 543d70e30c153522eedb986755ae3a5de8d820c6 (diff) | |
download | scala-8e320487627e85cce44a4eab0d77d28fd0904d50.tar.gz scala-8e320487627e85cce44a4eab0d77d28fd0904d50.tar.bz2 scala-8e320487627e85cce44a4eab0d77d28fd0904d50.zip |
One of those annoying patches for which I apolo...
One of those annoying patches for which I apologize in advance. It's a
step toward a better world. Almost all the changes herein are simple
transformations of "x hasFlag FOO" to "x.isFoo", with the remainder
minor cleanups. It's too big to review, so let's say no review:
but I'm still all ears for input on the issues mostly outlined in
HasFlags.scala.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala b/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala index 717b4e672e..7f8359fb94 100644 --- a/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala +++ b/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala @@ -194,8 +194,7 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT mayNeedProtectedAccessor(sel, args, false) case sel @ Select(qual @ This(_), name) => - if ((sym hasFlag PARAMACCESSOR) - && (sym.alias != NoSymbol)) { + if (sym.isParamAccessor && sym.alias != NoSymbol) { val result = localTyper.typed { Select( Super(qual.symbol, nme.EMPTY.toTypeName/*qual.symbol.info.parents.head.symbol.name*/) setPos qual.pos, @@ -208,9 +207,9 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT else mayNeedProtectedAccessor(sel, List(EmptyTree), false) case Select(sup @ Super(_, mix), name) => - if (sym.isValue && !sym.isMethod || sym.hasFlag(ACCESSOR)) { + if (sym.isValue && !sym.isMethod || sym.hasAccessorFlag) { unit.error(tree.pos, "super may be not be used on "+ - (if (sym.hasFlag(ACCESSOR)) sym.accessed else sym)) + (if (sym.hasAccessorFlag) sym.accessed else sym)) } else if (isDisallowed(sym)) { unit.error(tree.pos, "super not allowed here: use this." + name.decode + " instead") @@ -225,7 +224,7 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT case Assign(lhs @ Select(qual, name), rhs) => if (lhs.symbol.isVariable && - lhs.symbol.hasFlag(JAVA) && + lhs.symbol.isJavaDefined && needsProtectedAccessor(lhs.symbol, tree.pos)) { if (settings.debug.value) log("Adding protected setter for " + tree) val setter = makeSetter(lhs); |