summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2005-12-06 10:06:30 +0000
committerMartin Odersky <odersky@gmail.com>2005-12-06 10:06:30 +0000
commite9caaa6ac593fdc63d625d252863778cd7d89a16 (patch)
treeb775afaa42e6adaad477380c5b7650fe25c54d0e /sources
parent8bbd5b9c94edd98b450097d6c99ea2dfbafad05d (diff)
downloadscala-e9caaa6ac593fdc63d625d252863778cd7d89a16.tar.gz
scala-e9caaa6ac593fdc63d625d252863778cd7d89a16.tar.bz2
scala-e9caaa6ac593fdc63d625d252863778cd7d89a16.zip
*** empty log message ***
Diffstat (limited to 'sources')
-rwxr-xr-xsources/scala/tools/nsc/symtab/Types.scala6
-rwxr-xr-xsources/scala/tools/nsc/typechecker/Typers.scala9
2 files changed, 11 insertions, 4 deletions
diff --git a/sources/scala/tools/nsc/symtab/Types.scala b/sources/scala/tools/nsc/symtab/Types.scala
index 640366545d..dc48b51cd9 100755
--- a/sources/scala/tools/nsc/symtab/Types.scala
+++ b/sources/scala/tools/nsc/symtab/Types.scala
@@ -135,7 +135,7 @@ import Flags._;
*/
def decl(name: Name): Symbol = findDecl(name, 0);
- /** The non-orivate defined or declared members with name `name' in this type;
+ /** The non-private defined or declared members with name `name' in this type;
* an OverloadedSymbol if several exist, NoSymbol if none exist.
* Alternatives of overloaded symbol appear in the order they are declared.
*/
@@ -161,6 +161,10 @@ import Flags._;
* an OverloadedSymbol if several exist, NoSymbol if none exist */
def nonPrivateMember(name: Name): Symbol = findMember(name, PRIVATE | BRIDGE, 0);
+ /** The non-local member with given name,
+ * an OverloadedSymbol if several exist, NoSymbol if none exist */
+ def nonLocalMember(name: Name): Symbol = findMember(name, LOCAL | BRIDGE, 0);
+
/** The least type instance of given class which is a supertype
* of this type */
def baseType(clazz: Symbol): Type = NoType;
diff --git a/sources/scala/tools/nsc/typechecker/Typers.scala b/sources/scala/tools/nsc/typechecker/Typers.scala
index a161349a34..7046e4c163 100755
--- a/sources/scala/tools/nsc/typechecker/Typers.scala
+++ b/sources/scala/tools/nsc/typechecker/Typers.scala
@@ -930,9 +930,12 @@ import collection.mutable.HashMap;
"\n phase = " + phase);
}
tree.symbol
- } else {
- qual.tpe.member(name)
- }
+ } else qual.tpe match {
+ case ThisType(clazz) if (clazz == context.enclClass.owner) =>
+ qual.tpe.member(name)
+ case _ =>
+ qual.tpe.nonLocalMember(name)
+ }
if (sym == NoSymbol && qual.isTerm && (qual.symbol == null || qual.symbol.isValue) &&
!phase.erasedTypes && !qual.tpe.widen.isError) {
val coercion = inferView(qual.pos, qual.tpe, name, true);