diff options
author | paltherr <paltherr@epfl.ch> | 2003-09-08 15:35:05 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2003-09-08 15:35:05 +0000 |
commit | 0fd76c61fd1414b231589a8336b186e125dfd0ea (patch) | |
tree | c9b63e3a73c3ea24d88d64143fa4c12c2d5636d1 /sources | |
parent | 78c05c5995589a661f0ac5c6ec9376a122412a61 (diff) | |
download | scala-0fd76c61fd1414b231589a8336b186e125dfd0ea.tar.gz scala-0fd76c61fd1414b231589a8336b186e125dfd0ea.tar.bz2 scala-0fd76c61fd1414b231589a8336b186e125dfd0ea.zip |
- Changed rawInfoAt to not invoke transformInfo...
- Changed rawInfoAt to not invoke transformInfo for NoType, ErrorType
and OverloadedType
Diffstat (limited to 'sources')
-rw-r--r-- | sources/scalac/symtab/Symbol.java | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/sources/scalac/symtab/Symbol.java b/sources/scalac/symtab/Symbol.java index f332e16610..864edb624f 100644 --- a/sources/scalac/symtab/Symbol.java +++ b/sources/scalac/symtab/Symbol.java @@ -786,12 +786,8 @@ public abstract class Symbol implements Modifiers, Kinds { assert phase != null : this; if (infos.limit().precedes(phase)) { while (infos.limit().next != phase) { - Global global = phase.global; - Phase current = global.currentPhase; Phase next = infos.limit().next; - global.currentPhase = next; - Type info = next.transformInfo(this, infos.info); - global.currentPhase = current; + Type info = transformInfo(next, infos.info); if (info != infos.info) { infos = new TypeIntervalList(infos, info, next); } else { @@ -806,6 +802,37 @@ public abstract class Symbol implements Modifiers, Kinds { return infos.info; } } + // where + private Type transformInfo(Phase phase, Type info) { + Global global = phase.global; + Phase current = global.currentPhase; + switch (info) { + case ErrorType: + case NoType: + return info; + case OverloadedType(Symbol[] alts, Type[] alttypes): + global.currentPhase = phase.next; + for (int i = 0; i < alts.length; i++) { + Type type = alts[i].info(); + if (type != alttypes[i]) { + Type[] types = new Type[alttypes.length]; + for (int j = 0; j < i; j++) types[j] = alttypes[j]; + alttypes[i] = type; + for (; i < alts.length; i++) + types[i] = alts[i].info(); + global.currentPhase = current; + return Type.OverloadedType(alts, types); + } + } + global.currentPhase = current; + return info; + default: + global.currentPhase = phase; + info = phase.transformInfo(this, info); + global.currentPhase = current; + return info; + } + } /** Get first defined info, without forcing lazy types. */ |