@@ -391,18 +391,23 @@ object SymDenotations {
391
391
* Drops package objects. Represents each term in the owner chain by a simple `_$`.
392
392
*/
393
393
def fullNameSeparated (kind : QualifiedNameKind )(implicit ctx : Context ): Name =
394
- if (symbol == NoSymbol ||
395
- owner == NoSymbol ||
396
- owner.isEffectiveRoot ||
397
- kind == FlatName && owner.is(PackageClass )) name
394
+ maybeOwner.fullNameSeparated(kind, kind, name)
395
+
396
+ /** The encoded full path name of this denotation (separated by `prefixKind`),
397
+ * followed by the separator implied by `kind` and the given `name`.
398
+ * Drops package objects. Represents each term in the owner chain by a simple `_$`.
399
+ */
400
+ def fullNameSeparated (prefixKind : QualifiedNameKind , kind : QualifiedNameKind , name : Name )(implicit ctx : Context ): Name =
401
+ if (symbol == NoSymbol || isEffectiveRoot || kind == FlatName && is(PackageClass ))
402
+ name
398
403
else {
399
404
var filler = " "
400
- var encl = owner
405
+ var encl = symbol
401
406
while (! encl.isClass && ! encl.isPackageObject) {
402
407
encl = encl.owner
403
408
filler += " _$"
404
409
}
405
- var prefix = encl.fullNameSeparated(kind )
410
+ var prefix = encl.fullNameSeparated(prefixKind )
406
411
if (kind.separator == " $" )
407
412
// duplicate scalac's behavior: don't write a double '$$' for module class members.
408
413
prefix = prefix.exclude(ModuleClassName )
@@ -412,10 +417,9 @@ object SymDenotations {
412
417
case name : SimpleName => qualify(name)
413
418
case name @ AnyQualifiedName (_, _) => qualify(name.mangled.toSimpleName)
414
419
}
415
- if (isType) fn.toTypeName else fn.toTermName
420
+ if (name. isType) fn.toTypeName else fn.toTermName
416
421
}
417
422
418
-
419
423
/** The encoded flat name of this denotation, where joined names are separated by `separator` characters. */
420
424
def flatName (implicit ctx : Context ): Name = fullNameSeparated(FlatName )
421
425
0 commit comments