summaryrefslogtreecommitdiff
path: root/sources/scalac/symtab/Symbol.java
diff options
context:
space:
mode:
Diffstat (limited to 'sources/scalac/symtab/Symbol.java')
-rw-r--r--sources/scalac/symtab/Symbol.java18
1 files changed, 6 insertions, 12 deletions
diff --git a/sources/scalac/symtab/Symbol.java b/sources/scalac/symtab/Symbol.java
index d5785891d3..eacfdf0310 100644
--- a/sources/scalac/symtab/Symbol.java
+++ b/sources/scalac/symtab/Symbol.java
@@ -434,7 +434,12 @@ public abstract class Symbol implements Modifiers, Kinds {
/** Does this symbol denote a Java package? */
public final boolean isPackage() {
- return (flags & PACKAGE) != 0;
+ return kind == VAL && (flags & PACKAGE) != 0;
+ }
+
+ /** Does this symbol denote a Java package class? */
+ public final boolean isPackageClass() {
+ return kind == CLASS && (flags & PACKAGE) != 0;
}
/** Does this symbol denote a module? */
@@ -716,17 +721,6 @@ public abstract class Symbol implements Modifiers, Kinds {
return isMethod() ? this : owner().enclMethod();
}
- /** The top-level class enclosing `sym'
- */
- Symbol enclToplevelClass() {
- Symbol sym = this;
- while (sym.kind == VAL ||
- (sym.kind == CLASS && !sym.owner().isPackage())) {
- sym = sym.owner();
- }
- return sym;
- }
-
/** If this is a constructor, return the class it constructs.
* Otherwise return the symbol itself.
*/