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.scala7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/NameOps.scala b/src/dotty/tools/dotc/core/NameOps.scala
index c422c4ec5..6d3921ec2 100644
--- a/src/dotty/tools/dotc/core/NameOps.scala
+++ b/src/dotty/tools/dotc/core/NameOps.scala
@@ -49,7 +49,7 @@ object NameOps {
implicit class NameDecorator(val name: Name) extends AnyVal {
import nme._
- def isConstructorName = name == CONSTRUCTOR || name == MIXIN_CONSTRUCTOR
+ def isConstructorName = name == CONSTRUCTOR || name == TRAIT_CONSTRUCTOR
def isExceptionResultName = name startsWith EXCEPTION_RESULT_PREFIX
def isImplClassName = name endsWith IMPL_CLASS_SUFFIX
def isLocalDummyName = name startsWith LOCALDUMMY_PREFIX
@@ -159,6 +159,11 @@ object NameOps {
*/
def expandedName(base: Symbol, separator: Name = nme.EXPAND_SEPARATOR)(implicit ctx: Context): TypeName =
(base.fullName('$') ++ separator ++ name).toTypeName
+
+ def unexpandedName(separator: Name = nme.EXPAND_SEPARATOR) = {
+ val idx = name.lastIndexOfSlice(separator)
+ if (idx < 0) name else name drop (idx + separator.length)
+ }
}
implicit class TermNameDecorator(val name: TermName) extends AnyVal {