Skip to content

Commit 0584e0f

Browse files
committed
New SymDenotation method: expandedName.
1 parent 2ce940a commit 0584e0f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

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

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,13 @@ object SymDenotations {
286286

287287
// ------ Names ----------------------------------------------
288288

289+
/** The expanded name of this denotation. */
290+
final def expandedName(implicit ctx: Context) =
291+
if (is(ExpandedName) || isConstructor) name
292+
else name.expandedName(initial.asSymDenotation.owner)
293+
// need to use initial owner to disambiguate, as multiple private symbols with the same name
294+
// might have been moved from different origins into the same class
295+
289296
/** The name with which the denoting symbol was created */
290297
final def originalName(implicit ctx: Context) = {
291298
val d = initial.asSymDenotation
@@ -1081,11 +1088,7 @@ object SymDenotations {
10811088
def ensureNotPrivate(implicit ctx: Context) =
10821089
if (is(Private))
10831090
copySymDenotation(
1084-
name =
1085-
if (is(ExpandedName) || isConstructor) this.name
1086-
else this.name.expandedName(initial.asSymDenotation.owner),
1087-
// need to use initial owner to disambiguate, as multiple private symbols with the same name
1088-
// might have been moved from different origins into the same class
1091+
name = expandedName,
10891092
initFlags = this.flags &~ Private | ExpandedName)
10901093
else this
10911094
}

0 commit comments

Comments
 (0)