summaryrefslogtreecommitdiff
path: root/sources/scalac
diff options
context:
space:
mode:
Diffstat (limited to 'sources/scalac')
-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.