From 52d740d120cd197ee816aa0a06732ccdb5d5ab29 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sun, 17 Mar 2013 20:12:16 +0100 Subject: Added emulation of higher-kinded types. Also improvements to toString. --- src/dotty/tools/dotc/core/NameOps.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/dotty/tools/dotc/core/NameOps.scala') 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) -- cgit v1.2.3