diff options
author | paltherr <paltherr@epfl.ch> | 2003-08-18 22:24:07 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2003-08-18 22:24:07 +0000 |
commit | 1832dd1036e31de1de2e6d14c57444ac696746cd (patch) | |
tree | 85eb82f1366cf04cb13524ef3a1fdd0fbe1f0427 /sources/scalac/symtab/Symbol.java | |
parent | eae9ff36d8080e8f769d354153b275b8a6b0b128 (diff) | |
download | scala-1832dd1036e31de1de2e6d14c57444ac696746cd.tar.gz scala-1832dd1036e31de1de2e6d14c57444ac696746cd.tar.bz2 scala-1832dd1036e31de1de2e6d14c57444ac696746cd.zip |
- Removed constant Global.POST_ANALYZER_PHASE_ID.
- Removed constant Symbol.FIRST_ID.
- Added method Symbol.setFirstInfo(Type).
- Added method Symbol.rawFirstInfo().
- Renamed Symbol.setInfo(Type,int) into Symbol.setInfoAt(Type,int).
- Made Symbol.setInfoAt(Type,int) and Symbol.rawInfoAt(int) private.
- Changed Symbol.currentPhaseId() to always return id of current phase.
Diffstat (limited to 'sources/scalac/symtab/Symbol.java')
-rw-r--r-- | sources/scalac/symtab/Symbol.java | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/sources/scalac/symtab/Symbol.java b/sources/scalac/symtab/Symbol.java index 5abc022439..00161b7745 100644 --- a/sources/scalac/symtab/Symbol.java +++ b/sources/scalac/symtab/Symbol.java @@ -56,8 +56,6 @@ public abstract class Symbol implements Modifiers, Kinds { /** The infos of the symbol */ private TypeIntervalList infos = TypeIntervalList.EMPTY; - static public int FIRST_ID = Global.POST_ANALYZER_PHASE_ID; - // Constructors ----------------------------------------------------------- /** Generic symbol constructor */ @@ -135,10 +133,14 @@ public abstract class Symbol implements Modifiers, Kinds { /** Set information, except if symbol is both initialized and locked. */ public Symbol setInfo(Type info) { - return setInfo(info, currentPhaseId()); + return setInfoAt(info, currentPhaseId()); + } + + public Symbol setFirstInfo(Type info) { + return setInfoAt(info, 0); } - public Symbol setInfo(Type info, int limit) { + private Symbol setInfoAt(Type info, int limit) { assert !isConstructor() || info instanceof Type.LazyType || info == Type.NoType @@ -587,8 +589,7 @@ public abstract class Symbol implements Modifiers, Kinds { /** the current phase id, or the id after analysis, whichever is larger. */ static int currentPhaseId() { - int id = Global.instance.currentPhase.id; - return id < FIRST_ID ? FIRST_ID : id; + return Global.instance.currentPhase.id; } public int definedPhaseId() { @@ -629,7 +630,7 @@ public abstract class Symbol implements Modifiers, Kinds { //if (isModule()) moduleClass().initialize(); int id = currentPhaseId(); if ((flags & INITIALIZED) == 0) { - Type info = rawInfoAt(FIRST_ID); + Type info = rawFirstInfo(); assert info != null : this; if ((flags & LOCKED) != 0) { setInfo(Type.ErrorType); @@ -671,7 +672,7 @@ public abstract class Symbol implements Modifiers, Kinds { /** get info at phase #id, without forcing lazy types. */ - public Type rawInfoAt(int id) { + private Type rawInfoAt(int id) { //if (infos == TypeIntervalList.EMPTY) return Type.NoType;//DEBUG assert infos != TypeIntervalList.EMPTY : this; int nextid = infos.limit; @@ -699,6 +700,14 @@ public abstract class Symbol implements Modifiers, Kinds { } } + public Type rawFirstInfo() { + TypeIntervalList infos1 = infos; + while (infos1.prev.limit >= 0) { + infos1 = infos1.prev; + } + return infos1.info; + } + public Type rawInfo() { return rawInfoAt(currentPhaseId()); } |