diff options
author | paltherr <paltherr@epfl.ch> | 2003-11-18 07:34:35 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2003-11-18 07:34:35 +0000 |
commit | f28a8a337ed290b1f7dbb0bc493d83f576fb6352 (patch) | |
tree | 802e522496113f28cab0162185024e74986d1209 /sources | |
parent | 6a72d316aa50c13dc43bf095c3e344030a147098 (diff) | |
download | scala-f28a8a337ed290b1f7dbb0bc493d83f576fb6352.tar.gz scala-f28a8a337ed290b1f7dbb0bc493d83f576fb6352.tar.bz2 scala-f28a8a337ed290b1f7dbb0bc493d83f576fb6352.zip |
- Added some assertions on info
- Added methods isNone and isError
Diffstat (limited to 'sources')
-rw-r--r-- | sources/scalac/symtab/Symbol.java | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/sources/scalac/symtab/Symbol.java b/sources/scalac/symtab/Symbol.java index 878528accb..2587ac6463 100644 --- a/sources/scalac/symtab/Symbol.java +++ b/sources/scalac/symtab/Symbol.java @@ -193,7 +193,8 @@ public abstract class Symbol implements Modifiers, Kinds { * phase). */ private final Symbol setInfoAt(Type info, Phase phase) { - assert phase != null : this; + assert info != null: Debug.show(this); + assert phase != null: Debug.show(this); assert !isConstructor() || info instanceof Type.LazyType || info == Type.NoType @@ -225,9 +226,11 @@ public abstract class Symbol implements Modifiers, Kinds { * given phase. */ private final Symbol updateInfoAt(Type info, Phase phase) { - assert infos != null : this; + assert info != null: Debug.show(this); + assert phase != null: Debug.show(this); + assert infos != null: Debug.show(this); assert !phase.precedes(infos.limit()) : - this + " -- " + phase + " -- " + infos.limit(); + Debug.show(this) + " -- " + phase + " -- " + infos.limit(); if (infos.limit() == phase) { if (infos.start == phase) infos = infos.prev; @@ -258,6 +261,16 @@ public abstract class Symbol implements Modifiers, Kinds { // Symbol classification ---------------------------------------------------- + /** Does this symbol denote the error symbol? */ + public final boolean isError() { + return kind == Kinds.ERROR; + } + + /** Does this symbol denote the none symbol? */ + public final boolean isNone() { + return kind == Kinds.NONE; + } + /** Does this symbol denote a type? */ public final boolean isType() { return kind == TYPE || kind == CLASS || kind == ALIAS; @@ -859,6 +872,7 @@ public abstract class Symbol implements Modifiers, Kinds { while (infos.limit().next != phase) { Phase next = infos.limit().next; Type info = transformInfo(next, infos.info); + assert info != null: Debug.show(this) + " -- " + next; if (info != infos.info) { infos = new TypeIntervalList(infos, info, next); } else { @@ -2059,6 +2073,7 @@ class TypeIntervalList extends IntervalList { super(prev, start); this.prev = prev; this.info = info; + assert info != null; } } @@ -2075,6 +2090,7 @@ class ClosureIntervalList extends IntervalList { super(prev, start); this.prev = prev; this.closure = closure; + assert closure != null; } } |