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, 5 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/NameOps.scala b/src/dotty/tools/dotc/core/NameOps.scala
index f5e0eb8cd..48e823e81 100644
--- a/src/dotty/tools/dotc/core/NameOps.scala
+++ b/src/dotty/tools/dotc/core/NameOps.scala
@@ -84,6 +84,8 @@ object NameOps {
name.stripAnonNumberSuffix endsWith MODULE_VAR_SUFFIX
def isSelectorName = name.startsWith(" ") && name.tail.forall(_.isDigit)
def isLazyLocal = name.endsWith(nme.LAZY_LOCAL)
+ def isOuterSelect = name.endsWith(nme.OUTER_SELECT)
+ def isInlineAccessor = name.startsWith(nme.INLINE_ACCESSOR_PREFIX)
/** Is name a variable name? */
def isVariableName: Boolean = name.length > 0 && {
@@ -166,7 +168,7 @@ object NameOps {
// Hack to make super accessors from traits work. They would otherwise fail because of #765
// TODO: drop this once we have more robust name handling
- if (name.slice(idx - FalseSuperLength, idx) == FalseSuper)
+ if (idx > FalseSuperLength && name.slice(idx - FalseSuperLength, idx) == FalseSuper)
idx -= FalseSuper.length
if (idx < 0) name else (name drop (idx + nme.EXPAND_SEPARATOR.length)).asInstanceOf[N]
@@ -419,6 +421,8 @@ object NameOps {
assert(name.isLazyLocal)
name.dropRight(nme.LAZY_LOCAL.length)
}
+
+ def inlineAccessorName = nme.INLINE_ACCESSOR_PREFIX ++ name ++ "$"
}
private final val FalseSuper = "$$super".toTermName