summaryrefslogtreecommitdiff
path: root/sources/scalac/symtab/Symbol.java
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2003-08-28 15:04:01 +0000
committerMartin Odersky <odersky@gmail.com>2003-08-28 15:04:01 +0000
commitcef4819a2034134b26db1f6eb85c8999421af5c1 (patch)
treeb57925ad96c33df8e69a75b917fa147e8495ad8a /sources/scalac/symtab/Symbol.java
parent1ba1b5f0d6f3fea116ea5858842bb539257f511b (diff)
downloadscala-cef4819a2034134b26db1f6eb85c8999421af5c1.tar.gz
scala-cef4819a2034134b26db1f6eb85c8999421af5c1.tar.bz2
scala-cef4819a2034134b26db1f6eb85c8999421af5c1.zip
*** empty log message ***
Diffstat (limited to 'sources/scalac/symtab/Symbol.java')
-rw-r--r--sources/scalac/symtab/Symbol.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/sources/scalac/symtab/Symbol.java b/sources/scalac/symtab/Symbol.java
index 28772e6bc5..d0494f1f83 100644
--- a/sources/scalac/symtab/Symbol.java
+++ b/sources/scalac/symtab/Symbol.java
@@ -3,7 +3,11 @@
** __\_ \/ /_/ / /__/ /_/ /\_ \ (c) 2002, LAMP/EPFL **
** /_____/\____/\___/\____/____/ **
**
+<<<<<<< Symbol.java
** $Id$
+=======
+** $Id$
+>>>>>>> 1.80
\* */
//todo check significance of JAVA flag.
@@ -508,6 +512,11 @@ public abstract class Symbol implements Modifiers, Kinds {
return owner().enclClass();
}
+ /** The next enclosing method */
+ public Symbol enclMethod() {
+ return isMethod() ? this : owner().enclMethod();
+ }
+
/** The top-level class enclosing `sym'
*/
Symbol enclToplevelClass() {
@@ -1008,7 +1017,7 @@ public abstract class Symbol implements Modifiers, Kinds {
*/
public Symbol overridingSymbol(Type sub) {
assert !isOverloaded() : this;
- Symbol sym1 = sub.lookupNonPrivate(name);
+ Symbol sym1 = sub.lookup(name);
if (sym1.kind == Kinds.NONE || (sym1.flags & STATIC) != 0) {
return Symbol.NONE;
} else {
@@ -1711,6 +1720,11 @@ public final class ErrorSymbol extends Symbol {
return this;
}
+ /** Return the next enclosing method */
+ public Symbol enclMethod() {
+ return this;
+ }
+
public Type loBound() {
return Type.ErrorType;
}
@@ -1759,6 +1773,11 @@ public final class NoSymbol extends Symbol {
return this;
}
+ /** Return the next enclosing method */
+ public Symbol enclMethod() {
+ return this;
+ }
+
public Symbol owner() {
throw new ApplicationError();
}