diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2010-05-04 21:59:18 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2010-05-04 21:59:18 +0000 |
commit | 60cd12f77051898bc63cfa55bdd0cdafda4b510a (patch) | |
tree | c0cb0550fbd4ecba3abe5563f6003db7c6e50c48 /src/compiler | |
parent | 09bbc6ea28f1f5ad6d2902425cc42d10392a414a (diff) | |
download | scala-60cd12f77051898bc63cfa55bdd0cdafda4b510a.tar.gz scala-60cd12f77051898bc63cfa55bdd0cdafda4b510a.tar.bz2 scala-60cd12f77051898bc63cfa55bdd0cdafda4b510a.zip |
Fixing the conflict between the two private-rel...
Fixing the conflict between the two private-related bugs, fixing the
build. no review.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala index 94ae6be3e4..9215064856 100644 --- a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala +++ b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala @@ -1210,7 +1210,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { val symSubstituter = new ImplementationAdapter( parameters(source).flatten ::: origtparams, vparamss1.flatten.map(_.symbol) ::: newtparams, - symbol.enclClass) + source.enclClass) val tmp = symSubstituter(body(source).duplicate) tpt.tpe = tpt.tpe.substSym(oldtparams, newtparams) @@ -1233,8 +1233,8 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { else sym1 eq sym2 } - // initialize the current owner to the enclosing class - currentOwner = targetClass + private def isAccessible(sym: Symbol): Boolean = + (currentClass == sym.owner.enclClass) && (currentClass != targetClass) /** All private members that are referenced are made protected, * in order to be accessible from specialized subclasses. @@ -1243,9 +1243,8 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers { case Select(qual, name) => val sym = tree.symbol if (sym.hasFlag(PRIVATE)) - log("seeing private member " + sym + " targetClass: " + targetClass + " owner: " + sym.owner.enclClass) - if (sym.hasFlag(PRIVATE | PROTECTED) && !nme.isLocalName(sym.name) - && (currentClass != sym.owner.enclClass)) { + log("seeing private member " + sym + " targetClass: " + currentClass + " owner: " + sym.owner.enclClass) + if (sym.hasFlag(PRIVATE | PROTECTED) && !nme.isLocalName(sym.name) && !isAccessible(sym)) { log("changing private flag of " + sym) // tree.symbol.resetFlag(PRIVATE).setFlag(PROTECTED) sym.makeNotPrivate(sym.owner) |