diff options
author | Martin Odersky <odersky@gmail.com> | 2017-03-27 21:55:26 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2017-04-11 09:33:11 +0200 |
commit | 0021ffb0f1a0a857b7cdc8cdf769ae727dcb4b2c (patch) | |
tree | 89499a1172e48e81a86d61242090819d658c5aa7 /compiler/src/dotty/tools/dotc/core/NameOps.scala | |
parent | 1d6f5f7f33f9e4be29553cb7ef1e6f054a64dc6b (diff) | |
download | dotty-0021ffb0f1a0a857b7cdc8cdf769ae727dcb4b2c.tar.gz dotty-0021ffb0f1a0a857b7cdc8cdf769ae727dcb4b2c.tar.bz2 dotty-0021ffb0f1a0a857b7cdc8cdf769ae727dcb4b2c.zip |
Add ShadowedName and AvoidClashName
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core/NameOps.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/NameOps.scala | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/NameOps.scala b/compiler/src/dotty/tools/dotc/core/NameOps.scala index f467fbcd5..031cda1bd 100644 --- a/compiler/src/dotty/tools/dotc/core/NameOps.scala +++ b/compiler/src/dotty/tools/dotc/core/NameOps.scala @@ -64,10 +64,8 @@ object NameOps { def isReplWrapperName = name.toSimpleName containsSlice INTERPRETER_IMPORT_WRAPPER def isSetterName = name endsWith SETTER_SUFFIX def isSingletonName = name endsWith SINGLETON_SUFFIX - def isAvoidClashName = name endsWith AVOID_CLASH_SUFFIX def isImportName = name startsWith IMPORT def isFieldName = name endsWith LOCAL_SUFFIX - def isShadowedName = name.startsWith(nme.SHADOWED) def isDefaultGetterName = name.isTermName && name.asTermName.defaultGetterIndex >= 0 def isScala2LocalSuffix = name.endsWith(" ") def isModuleVarName(name: Name): Boolean = @@ -119,17 +117,10 @@ object NameOps { /** If name ends in module class suffix, drop it */ def stripModuleClassSuffix: Name = name.exclude(ModuleClassName) - /** Append a suffix so that this name does not clash with another name in the same scope */ - def avoidClashName: TermName = (name ++ AVOID_CLASH_SUFFIX).toTermName - - /** If name ends in "avoid clash" suffix, drop it */ - def stripAvoidClashSuffix: Name = - if (isAvoidClashName) name dropRight AVOID_CLASH_SUFFIX.length else name - /** If flags is a ModuleClass but not a Package, add module class suffix */ def adjustIfModuleClass(flags: Flags.FlagSet): N = { if (flags is (ModuleClass, butNot = Package)) name.asTypeName.moduleClassName - else stripAvoidClashSuffix + else likeTyped(name.toTermName.exclude(AvoidClashName)) }.asInstanceOf[N] /** The superaccessor for method with given name */ @@ -192,10 +183,6 @@ object NameOps { } else name - def shadowedName: N = likeTyped(nme.SHADOWED ++ name) - - def revertShadowed: N = likeTyped(name.drop(nme.SHADOWED.length)) - def implClassName: N = likeTyped(name ++ tpnme.IMPL_CLASS_SUFFIX) def errorName: N = likeTyped(name ++ nme.ERROR) |