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/transform/ExplicitOuter.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/transform/ExplicitOuter.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala b/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala index 1403377367..9f6117dcf1 100644 --- a/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala +++ b/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala @@ -161,8 +161,8 @@ abstract class ExplicitOuter extends InfoTransform // On the other hand, mixing in the trait into a separately compiled // class needs to have a common naming scheme, independently of whether // the field was accessed from an inner class or not. See #2946 - if (sym.owner.isTrait && (sym hasFlag LOCAL) && - ((sym.getter(sym.owner.toInterface) == NoSymbol) && (!sym.isLazy || (sym.lazyAccessor == NoSymbol)))) + if (sym.owner.isTrait && sym.hasLocalFlag && + ((sym.getter(sym.owner.toInterface) == NoSymbol) && !sym.isLazyAccessor)) sym.makeNotPrivate(sym.owner) tp } @@ -343,12 +343,9 @@ abstract class ExplicitOuter extends InfoTransform /** If FLAG is set on symbol, sets notFLAG (this exists in anticipation of generalizing). */ def setNotFlags(sym: Symbol, flags: Int*) { - val notMap = Map( - PRIVATE -> notPRIVATE, - PROTECTED -> notPROTECTED - ) - for (f <- flags ; notFlag <- notMap get f ; if sym hasFlag f) - sym setFlag notFlag + for (f <- flags ; notFlag <- notFlagMap get f) + if (sym hasFlag f) + sym setFlag notFlag } def matchTranslation(tree: Match) = { @@ -461,7 +458,7 @@ abstract class ExplicitOuter extends InfoTransform super.transform(tree) case This(qual) => - if (sym == currentClass || (sym hasFlag MODULE) && sym.isStatic) tree + if (sym == currentClass || sym.hasModuleFlag && sym.isStatic) tree else atPos(tree.pos)(outerPath(outerValue, currentClass.outerClass, sym)) // (5) case Select(qual, name) => |