summaryrefslogtreecommitdiff
path: root/sources/scalac/symtab/Symbol.java
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2003-06-04 14:53:23 +0000
committerMartin Odersky <odersky@gmail.com>2003-06-04 14:53:23 +0000
commit3a593c580c9a23b3654ea3391fb22afa85db0697 (patch)
tree193a2614a7a55cd4e5304a22e7761c88ba23f6e6 /sources/scalac/symtab/Symbol.java
parent6af6dae0df106de569e9b9cf503b3350722e58eb (diff)
downloadscala-3a593c580c9a23b3654ea3391fb22afa85db0697.tar.gz
scala-3a593c580c9a23b3654ea3391fb22afa85db0697.tar.bz2
scala-3a593c580c9a23b3654ea3391fb22afa85db0697.zip
*** empty log message ***
Diffstat (limited to 'sources/scalac/symtab/Symbol.java')
-rw-r--r--sources/scalac/symtab/Symbol.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/sources/scalac/symtab/Symbol.java b/sources/scalac/symtab/Symbol.java
index c4f0c1a9c6..65184b2134 100644
--- a/sources/scalac/symtab/Symbol.java
+++ b/sources/scalac/symtab/Symbol.java
@@ -496,11 +496,17 @@ public abstract class Symbol implements Modifiers, Kinds {
/** the current phase id, or the id after analysis, whichever is larger.
*/
- int currentPhaseId() {
+ static int currentPhaseId() {
int id = Global.instance.currentPhase.id;
return id < FIRST_ID ? FIRST_ID : id;
}
+ public int definedPhaseId() {
+ TypeIntervalList i = infos;
+ while (i.prev != TypeIntervalList.EMPTY) i = i.prev;
+ return i.limit;
+ }
+
/** Is this symbol initialized? */
public final boolean isInitialized() {
return (flags & INITIALIZED) != 0;
@@ -869,6 +875,7 @@ public abstract class Symbol implements Modifiers, Kinds {
return Symbol.NONE;
} else {
//System.out.println(this + ":" + this.type() + locationString() + " overrides? " + sym1 + sym1.type() + sym1.locationString()); //DEBUG
+ //System.out.println(owner.thisType());//DEBUG
Type symtype = owner.thisType().memberType(this);
//todo: try whether we can do: this.type(); instead
@@ -1046,7 +1053,7 @@ public class TypeSymbol extends Symbol {
if (kind == ALIAS) return info().symbol().closure();
int id = currentPhaseId();
if (closures.limit < id) {
- if (id == FIRST_ID || changes(closureAt(id - 1))) {
+ if (id <= definedPhaseId() || changes(closureAt(id - 1))) {
closures = new ClosureIntervalList(closures);
closures.limit = id;
computeClosure();
@@ -1090,6 +1097,7 @@ public class TypeSymbol extends Symbol {
assert closures.closure != BAD_CLOSURE : this;
closures.closure = BAD_CLOSURE; // to catch cycles.
// todo: why can't we do: inclClosure(SymSet.EMPTY, this) ?
+ //System.out.println("computing closure of " + this);//DEBUG
SymSet closureClassSet = inclClosure(SymSet.EMPTY, type().parents());
Symbol[] closureClasses = new Symbol[closureClassSet.size() + 1];
closureClasses[0] = this;