aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/NameOps.scala
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2016-10-06 15:02:17 +0200
committerGitHub <noreply@github.com>2016-10-06 15:02:17 +0200
commit87a775724173bd803a0c4956408e61fd0d5812af (patch)
treec564a236f9247b085ed26c1fb007dad74ed049dd /src/dotty/tools/dotc/core/NameOps.scala
parenta3064622e7ce4d73ddd91de0fc6bebfe0ec23ae9 (diff)
parente0a14e7939eda6a7f4914831975b2ac8877696f2 (diff)
downloaddotty-87a775724173bd803a0c4956408e61fd0d5812af.tar.gz
dotty-87a775724173bd803a0c4956408e61fd0d5812af.tar.bz2
dotty-87a775724173bd803a0c4956408e61fd0d5812af.zip
Merge pull request #1492 from dotty-staging/add-inline
Implement inline
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