diff options
author | Paul Phillips <paulp@improving.org> | 2013-04-08 18:28:24 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2013-04-08 23:08:07 -0700 |
commit | 7ee950fc3002632065e6f9e9b29e4c9be1138b88 (patch) | |
tree | a49d49bd4ebfdd8e79843b6b259a31bc0867598d /src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala | |
parent | 967087811f9215d72651fc62e0977291efa2ab43 (diff) | |
parent | 53e031f55386d131b1aaa5fb93ee1a3ac6bce646 (diff) | |
download | scala-7ee950fc3002632065e6f9e9b29e4c9be1138b88.tar.gz scala-7ee950fc3002632065e6f9e9b29e4c9be1138b88.tar.bz2 scala-7ee950fc3002632065e6f9e9b29e4c9be1138b88.zip |
Merge remote-tracking branch 'origin/2.10.x' into merge-2.10.x
* origin/2.10.x:
if starr.use.released fetch Scala ${starr.version} for STARR
assume build.release when maven.version.suffix is set
make quick.done depend on quick.bin again
SI-7321 Memory leak in specialize on multiple compiler runs.
Take the N^2 out of the compiler's TreeSet.
SI-6900 Fix tailrec for dependent method types
Simplify interplay between Uncurry Info- and Tree-Transformers
Refactor existential related code out of types.
Add a cautionary comment to TreeSymSubstitutor.
SI-6715 Shouldn't return "" from TermNames.originalName
Backport #2289's TermNames.unexpandedName as TermNames.originalName
SI-7147 Diagnostic for unexplained assertion in presentation compiler.
SI-6793 Don't use super param accessors if inaccessible.
Correct sorting example for Ordering in scaladoc
Conflicts:
bincompat-backward.whitelist.conf
bincompat-forward.whitelist.conf
build.xml
src/compiler/scala/tools/nsc/transform/UnCurry.scala
src/reflect/scala/reflect/internal/StdNames.scala
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala b/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala index b4270ea322..e22dc73b53 100644 --- a/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala +++ b/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala @@ -256,9 +256,16 @@ abstract class SuperAccessors extends transform.Transform with transform.TypingT } } - // direct calls to aliases of param accessors to the superclass in order to avoid + + def isAccessibleFromSuper(sym: Symbol) = { + val pre = SuperType(sym.owner.tpe, qual.tpe) + localTyper.context.isAccessible(sym, pre, superAccess = true) + } + + // Direct calls to aliases of param accessors to the superclass in order to avoid // duplicating fields. - if (sym.isParamAccessor && sym.alias != NoSymbol) { + // ... but, only if accessible (SI-6793) + if (sym.isParamAccessor && sym.alias != NoSymbol && isAccessibleFromSuper(sym.alias)) { val result = (localTyper.typedPos(tree.pos) { Select(Super(qual, tpnme.EMPTY) setPos qual.pos, sym.alias) }).asInstanceOf[Select] |