aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/NameOps.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools/dotc/core/NameOps.scala')
-rw-r--r--src/dotty/tools/dotc/core/NameOps.scala6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/NameOps.scala b/src/dotty/tools/dotc/core/NameOps.scala
index f50b44ac8..e83278814 100644
--- a/src/dotty/tools/dotc/core/NameOps.scala
+++ b/src/dotty/tools/dotc/core/NameOps.scala
@@ -103,8 +103,10 @@ object NameOps {
/** The expanded name of `name` relative to this class `base` with given `separator`
*/
- def expandedName(base: Symbol, separator: Name = nme.EXPAND_SEPARATOR)(implicit ctx: Context): N =
- name.fromName(base.fullName('$') ++ separator ++ name).asInstanceOf[N]
+ def expandedName(base: Symbol, separator: Name = nme.EXPAND_SEPARATOR)(implicit ctx: Context): N = {
+ val prefix = if (base is Flags.ExpandedName) base.name else base.fullName('$')
+ name.fromName(prefix ++ separator ++ name).asInstanceOf[N]
+ }
def unexpandedName(separator: Name = nme.EXPAND_SEPARATOR): N = {
val idx = name.lastIndexOfSlice(separator)