@@ -7,7 +7,7 @@ import Symbols._
77import Flags ._
88import Names ._
99import StdNames ._ , NameOps ._
10- import NameKinds .{ShadowedName , SkolemName , SignedName }
10+ import NameKinds .{SkolemName , SignedName }
1111import Scopes ._
1212import Constants ._
1313import Contexts ._
@@ -1764,8 +1764,7 @@ object Types {
17641764 def reloadDenot ()(implicit ctx : Context ) = setDenot(loadDenot)
17651765
17661766 protected def asMemberOf (prefix : Type , allowPrivate : Boolean )(implicit ctx : Context ): Denotation =
1767- if (name.is(ShadowedName )) prefix.nonPrivateMember(name.exclude(ShadowedName ))
1768- else if (nameSpace != noNameSpace) nameSpace.findMember(name, prefix, EmptyFlags )
1767+ if (nameSpace != noNameSpace) nameSpace.findMember(name, prefix, EmptyFlags )
17691768 else if (allowPrivate) prefix.member(name)
17701769 else prefix.nonPrivateMember(name)
17711770
@@ -1918,31 +1917,10 @@ object Types {
19181917 if (nameSpace == this .nameSpace) this
19191918 else NamedType (prefix, designator.withNameSpace(nameSpace))
19201919
1921- /** Create a NamedType of the same kind as this type, but with a "inherited name".
1922- * This is necessary to in situations like the following:
1923- *
1924- * class B { def m: T1 }
1925- * class C extends B { private def m: T2; ... C.m }
1926- * object C extends C
1927- * object X { ... C.m }
1928- *
1929- * The two references of C.m in class C and object X refer to different
1930- * definitions: The one in C refers to C#m whereas the one in X refers to B#m.
1931- * But the type C.m must have only one denotation, so it can't refer to two
1932- * members depending on context.
1933- *
1934- * In situations like this, the reference in X would get the type
1935- * `<C.m>.shadowed` to make clear that we mean the inherited member, not
1936- * the private one.
1937- *
1938- * Note: An alternative, possibly more robust scheme would be to give
1939- * private members special names. A private definition would have a special
1940- * name (say m' in the example above), but would be entered in its enclosing
1941- * under both private and public names, so it could still be found by looking up
1942- * the public name.
1920+ /** Create a NamedType of the same kind as this type, but without a namespace
19431921 */
1944- def shadowed (implicit ctx : Context ): NamedType =
1945- (designator : Designator ) match { // Dotty deviation: need the widening
1922+ def withoutNameSpace (implicit ctx : Context ): NamedType =
1923+ (designator : Designator ) match { // Dotty deviation: need the widening
19461924 case LocalName (underlying, _) => NamedType (prefix, underlying)
19471925 case _ => this
19481926 }
@@ -2018,8 +1996,8 @@ object Types {
20181996 fixDenot(TermRef (prefix, designator1), prefix)
20191997 }
20201998
2021- override def shadowed (implicit ctx : Context ): NamedType =
2022- fixDenot(super .shadowed .asInstanceOf [TermRef ], prefix)
1999+ override def withoutNameSpace (implicit ctx : Context ): NamedType =
2000+ fixDenot(super .withoutNameSpace .asInstanceOf [TermRef ], prefix)
20232001 }
20242002
20252003 abstract case class TypeRef (override val prefix : Type , designator : TypeDesignator ) extends NamedType {
0 commit comments