summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2003-10-15 09:17:58 +0000
committerpaltherr <paltherr@epfl.ch>2003-10-15 09:17:58 +0000
commit2755e0794f951b34ecb13450cd55dc8fbac8598a (patch)
tree95181fb0a068f569a39aab3fe9f0a5ac616db2de /sources
parent1f454cd1cb6ba7b1afd522e65a32fc90bda11fa4 (diff)
downloadscala-2755e0794f951b34ecb13450cd55dc8fbac8598a.tar.gz
scala-2755e0794f951b34ecb13450cd55dc8fbac8598a.tar.bz2
scala-2755e0794f951b34ecb13450cd55dc8fbac8598a.zip
- Added method isInitializer
- Changed method isConstructor to return false for initializers
Diffstat (limited to 'sources')
-rw-r--r--sources/scalac/symtab/Symbol.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/sources/scalac/symtab/Symbol.java b/sources/scalac/symtab/Symbol.java
index 3303edac5f..472295fbbb 100644
--- a/sources/scalac/symtab/Symbol.java
+++ b/sources/scalac/symtab/Symbol.java
@@ -496,6 +496,11 @@ public abstract class Symbol implements Modifiers, Kinds {
owner.isLocalClass());
}
+ /** Is this symbol an instance initializer? */
+ public boolean isInitializer() {
+ return false;
+ }
+
/** Is this symbol a constructor? */
public boolean isConstructor() {
return false;
@@ -1333,9 +1338,14 @@ public class TermSymbol extends Symbol {
else return super.fullName();
}
+ /** Is this symbol an instance initializer? */
+ public boolean isInitializer() {
+ return clazz == null && name == Names.CONSTRUCTOR;
+ }
+
/** Is this symbol a constructor? */
public boolean isConstructor() {
- return name == Names.CONSTRUCTOR;
+ return clazz != null && name == Names.CONSTRUCTOR;
}
/** Return a fresh symbol with the same fields as this one.