Skip to content

Commit d5df72a

Browse files
committed
New method for SymDenotations: ensureNotPrivate
Resets private flag, and expands the name if necessary.
1 parent 661068a commit d5df72a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/dotty/tools/dotc/core/SymDenotations.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,6 +1049,13 @@ object SymDenotations {
10491049
*/
10501050
override def transformAfter(phase: DenotTransformer, f: SymDenotation => SymDenotation)(implicit ctx: Context): Unit =
10511051
super.transformAfter(phase, f)
1052+
1053+
def ensureNotPrivate(implicit ctx: Context) =
1054+
if (is(Private))
1055+
copySymDenotation(
1056+
name = if (is(ExpandedName) || isConstructor) this.name else this.name.expandedName(owner),
1057+
initFlags = this.flags &~ Private | ExpandedName)
1058+
else this
10521059
}
10531060

10541061
/** The contents of a class definition during a period

0 commit comments

Comments
 (0)