summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2004-04-15 10:43:58 +0000
committerpaltherr <paltherr@epfl.ch>2004-04-15 10:43:58 +0000
commite884c5b4714f628afd21ed2573d97bd333f9a97e (patch)
tree75fcfde7adbc087aa172bf3c6e43499d3e611720
parentc1d2e4fa485c99e4f90838d630269caf3964b758 (diff)
downloadscala-e884c5b4714f628afd21ed2573d97bd333f9a97e.tar.gz
scala-e884c5b4714f628afd21ed2573d97bd333f9a97e.tar.bz2
scala-e884c5b4714f628afd21ed2573d97bd333f9a97e.zip
- Added flag IS_CONSTRUCTOR
- Readded location in locationString
-rw-r--r--sources/scalac/symtab/Symbol.java17
1 files changed, 6 insertions, 11 deletions
diff --git a/sources/scalac/symtab/Symbol.java b/sources/scalac/symtab/Symbol.java
index 1b32899c69..f00f33184c 100644
--- a/sources/scalac/symtab/Symbol.java
+++ b/sources/scalac/symtab/Symbol.java
@@ -39,6 +39,7 @@ public abstract class Symbol implements Modifiers, Kinds {
public static final int IS_ROOT = 0x00000001;
public static final int IS_ANONYMOUS = 0x00000002;
public static final int IS_LABEL = 0x00000010;
+ public static final int IS_CONSTRUCTOR = 0x00000020;
public static final int IS_ACCESSMETHOD = 0x00000100;
public static final int IS_ERROR = 0x10000000;
public static final int IS_THISTYPE = 0x20000000;
@@ -786,8 +787,8 @@ public abstract class Symbol implements Modifiers, Kinds {
}
/** Is this symbol a constructor? */
- public boolean isConstructor() {
- return false;
+ public final boolean isConstructor() {
+ return (attrs & IS_CONSTRUCTOR) != 0;
}
/** Is this symbol the primary constructor of a type? */
@@ -1476,10 +1477,8 @@ public abstract class Symbol implements Modifiers, Kinds {
if (owner.kind == CLASS &&
!owner.isAnonymousClass() && !owner.isCompoundSym() ||
Global.instance.debug)
- return " in " + owner;
- /*
- (owner.isModuleClass() ? ((ClassSymbol) owner).module() : owner);
- */
+ return " in " +
+ (owner.isModuleClass() ? owner.sourceModule() : owner);
else
return "";
}
@@ -1677,7 +1676,7 @@ final class ConstructorSymbol extends TermSymbol {
/** Initializes this instance. */
ConstructorSymbol(Symbol clasz, int pos, int flags) {
- super(clasz.owner(), pos, flags, Names.CONSTRUCTOR, 0);
+ super(clasz.owner(), pos, flags, Names.CONSTRUCTOR, IS_CONSTRUCTOR);
this.clasz = clasz;
}
@@ -1685,10 +1684,6 @@ final class ConstructorSymbol extends TermSymbol {
return false;
}
- public boolean isConstructor() {
- return true;
- }
-
public Symbol constructorClass() {
return clasz;
}