diff options
Diffstat (limited to 'src/dotty/tools/dotc/core')
-rw-r--r-- | src/dotty/tools/dotc/core/Flags.scala | 5 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 18 |
2 files changed, 6 insertions, 17 deletions
diff --git a/src/dotty/tools/dotc/core/Flags.scala b/src/dotty/tools/dotc/core/Flags.scala index 20427516d..532f6d00f 100644 --- a/src/dotty/tools/dotc/core/Flags.scala +++ b/src/dotty/tools/dotc/core/Flags.scala @@ -190,6 +190,8 @@ object Flags { /** Labeled with `private` modifier */ final val Private = commonFlag(2, "private") + final val PrivateTerm = Private.toTermFlags + final val PrivateType = Private.toTypeFlags /** Labeled with `protected` modifier */ final val Protected = commonFlag(3, "protected") @@ -356,6 +358,9 @@ object Flags { // Flags following this one are not pickled + /** Symbol with private access is accessed outside its private scope */ + final val NotJavaPrivate = commonFlag(47, "<not-java-private>") + /** Denotation is in train of being loaded and completed, used to catch cyclic dependencies */ final val Touched = commonFlag(48, "<touched>") diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index bd269bbcc..310dde912 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -805,7 +805,7 @@ object SymDenotations { */ final def accessBoundary(base: Symbol)(implicit ctx: Context): Symbol = { val fs = flags - if (fs is Private) owner + if (fs is (Private, butNot = NotJavaPrivate)) owner else if (fs is StaticProtected) defn.RootClass else if (privateWithin.exists && !ctx.phase.erasedTypes) privateWithin else if (fs is Protected) base @@ -890,22 +890,6 @@ object SymDenotations { /** Install this denotation as the result of the given denotation transformer. */ override def installAfter(phase: DenotTransformer)(implicit ctx: Context): Unit = super.installAfter(phase) - - /** Remove private modifier from symbol's definition. If this symbol - * is not a constructor nor a static module, rename it by expanding its name to avoid name clashes - * @param base the fully qualified name of this class will be appended if name expansion is needed - */ - final def makeNotPrivateAfter(base: Symbol, phase: DenotTransformer)(implicit ctx: Context): Unit = { - if (this.is(Private)) { - val newName = - if (this.is(Module) && isStatic || isClassConstructor) name - else { - if (this.is(Module)) moduleClass.makeNotPrivateAfter(base, phase) - name.expandedName(base) - } - copySymDenotation(name = newName, initFlags = flags &~ Private).installAfter(phase) - } - } } /** The contents of a class definition during a period |