diff options
-rw-r--r-- | src/dotty/tools/dotc/core/NameOps.scala | 6 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/StdNames.scala | 2 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 4 | ||||
-rw-r--r-- | src/dotty/tools/dotc/transform/Erasure.scala | 2 |
4 files changed, 7 insertions, 7 deletions
diff --git a/src/dotty/tools/dotc/core/NameOps.scala b/src/dotty/tools/dotc/core/NameOps.scala index c15c4c4c2..a003b4329 100644 --- a/src/dotty/tools/dotc/core/NameOps.scala +++ b/src/dotty/tools/dotc/core/NameOps.scala @@ -75,7 +75,7 @@ object NameOps { def isAvoidClashName = name endsWith AVOID_CLASH_SUFFIX def isImportName = name startsWith IMPORT def isFieldName = name endsWith LOCAL_SUFFIX - def isInheritedName = name.length > 0 && name.head == '(' && name.startsWith(nme.INHERITED) + def isShadowedName = name.length > 0 && name.head == '(' && name.startsWith(nme.SHADOWED) def isDefaultGetterName = name.isTermName && name.asTermName.defaultGetterIndex >= 0 def isScala2LocalSuffix = name.endsWith(" ") def isModuleVarName(name: Name): Boolean = @@ -159,9 +159,9 @@ object NameOps { if (idx < 0) name else (name drop (idx + separator.length)).asInstanceOf[N] } - def inheritedName: N = likeTyped(nme.INHERITED ++ name) + def shadowedName: N = likeTyped(nme.SHADOWED ++ name) - def revertInherited: N = likeTyped(name.drop(nme.INHERITED.length)) + def revertShadowed: N = likeTyped(name.drop(nme.SHADOWED.length)) /** Translate a name into a list of simple TypeNames and TermNames. * In all segments before the last, type/term is determined by whether diff --git a/src/dotty/tools/dotc/core/StdNames.scala b/src/dotty/tools/dotc/core/StdNames.scala index 19a210a32..7b730d4d7 100644 --- a/src/dotty/tools/dotc/core/StdNames.scala +++ b/src/dotty/tools/dotc/core/StdNames.scala @@ -100,7 +100,6 @@ object StdNames { val EXPAND_SEPARATOR: N = "$$" val IMPL_CLASS_SUFFIX: N = "$class" val IMPORT: N = "<import>" - val INHERITED: N = "(inherited)" // tag to be used until we have proper name kinds val INTERPRETER_IMPORT_WRAPPER: N = "$iw" val INTERPRETER_LINE_PREFIX: N = "line" val INTERPRETER_VAR_PREFIX: N = "res" @@ -118,6 +117,7 @@ object StdNames { val PROTECTED_PREFIX: N = "protected$" val PROTECTED_SET_PREFIX: N = PROTECTED_PREFIX + "set" val ROOT: N = "<root>" + val SHADOWED: N = "(shadowed)" // tag to be used until we have proper name kinds val SINGLETON_SUFFIX: N = ".type" val SPECIALIZED_SUFFIX: N = "$sp" val SUPER_PREFIX: N = "super$" diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index c3222c2ee..ea4101558 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -1320,7 +1320,7 @@ object Types { } protected def asMemberOf(prefix: Type)(implicit ctx: Context) = - if (name.isInheritedName) prefix.nonPrivateMember(name.revertInherited) + if (name.isShadowedName) prefix.nonPrivateMember(name.revertShadowed) else prefix.member(name) /** (1) Reduce a type-ref `W # X` or `W { ... } # U`, where `W` is a wildcard type @@ -1418,7 +1418,7 @@ object Types { * the public name. */ final def shadowed(implicit ctx: Context): NamedType = - NamedType(prefix, name.inheritedName) + NamedType(prefix, name.shadowedName) override def equals(that: Any) = that match { case that: NamedType => diff --git a/src/dotty/tools/dotc/transform/Erasure.scala b/src/dotty/tools/dotc/transform/Erasure.scala index 7fd5109c4..3a4487af5 100644 --- a/src/dotty/tools/dotc/transform/Erasure.scala +++ b/src/dotty/tools/dotc/transform/Erasure.scala @@ -278,7 +278,7 @@ object Erasure extends TypeTestsCasts{ def select(qual: Tree, sym: Symbol): Tree = { val name = tree.typeOpt match { - case tp: NamedType if tp.name.isInheritedName => sym.name.inheritedName + case tp: NamedType if tp.name.isShadowedName => sym.name.shadowedName case _ => sym.name } untpd.cpy.Select(tree)(qual, sym.name) |