aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/NameOps.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-03-17 20:12:16 +0100
committerMartin Odersky <odersky@gmail.com>2013-03-17 20:12:16 +0100
commit52d740d120cd197ee816aa0a06732ccdb5d5ab29 (patch)
tree6c6e7120ff879f72e8f7fa95b72ea5b7cdbe321c /src/dotty/tools/dotc/core/NameOps.scala
parent1d029f5f8f90a909ed140f7ef5cf656fafd9fc27 (diff)
downloaddotty-52d740d120cd197ee816aa0a06732ccdb5d5ab29.tar.gz
dotty-52d740d120cd197ee816aa0a06732ccdb5d5ab29.tar.bz2
dotty-52d740d120cd197ee816aa0a06732ccdb5d5ab29.zip
Added emulation of higher-kinded types.
Also improvements to toString.
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)