diff options
author | Martin Odersky <odersky@gmail.com> | 2006-08-16 15:14:05 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2006-08-16 15:14:05 +0000 |
commit | 22a098bf7e2515f5585be0ddf2d0a9f09e2b9e9d (patch) | |
tree | afe3a132ecddcad32300dc9919fac5ab58601f2b | |
parent | 840911b8e30c0ef203a087ca4d91a24f148f3dd9 (diff) | |
download | scala-22a098bf7e2515f5585be0ddf2d0a9f09e2b9e9d.tar.gz scala-22a098bf7e2515f5585be0ddf2d0a9f09e2b9e9d.tar.bz2 scala-22a098bf7e2515f5585be0ddf2d0a9f09e2b9e9d.zip |
mangle symbols that are qualified private up to...
mangle symbols that are qualified private up to an enclosing class
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala b/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala index 37163a18d8..29842d54c9 100644 --- a/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala +++ b/src/compiler/scala/tools/nsc/typechecker/SuperAccessors.scala @@ -14,6 +14,8 @@ import nsc.symtab.Flags._; * references to these aliases. * The phase also checks that symbols accessed from super are not abstract, * or are overridden by an abstract override. + * Finally, the phase also mangles the names of class-members which are private + * up to an enclosing non-package class, in order to avoid overriding conflicts. */ abstract class SuperAccessors extends transform.Transform { // inherits abstract value `global' and class `Phase' from Transform @@ -42,6 +44,12 @@ abstract class SuperAccessors extends transform.Transform { } override def transform(tree: Tree): Tree = tree match { + case ClassDef(_, _, _, _, _) => + for (val sym <- tree.symbol.info.decls.elements) { + if (sym.privateWithin.isClass && !sym.privateWithin.isModuleClass) + sym.expandName(sym.privateWithin) + } + super.transform(tree) case Template(parents, body) => val ownAccDefs = new ListBuffer[Tree]; accDefs = Pair(currentOwner, ownAccDefs) :: accDefs; |