summaryrefslogtreecommitdiff
path: root/sources/scalac/Global.java
diff options
context:
space:
mode:
Diffstat (limited to 'sources/scalac/Global.java')
-rw-r--r--sources/scalac/Global.java28
1 files changed, 22 insertions, 6 deletions
diff --git a/sources/scalac/Global.java b/sources/scalac/Global.java
index 15eb81baf8..c4ecc98a88 100644
--- a/sources/scalac/Global.java
+++ b/sources/scalac/Global.java
@@ -17,10 +17,7 @@ import scalac.symtab.Definitions;
import scalac.ast.printer.*;
import scalac.backend.Primitives;
// !!! <<< Interpreter stuff
-import scalac.symtab.Kinds;
-import scalac.symtab.Type;
-import scalac.symtab.Symbol;
-import scalac.symtab.Scope;
+import scalac.symtab.*;
// !!! >>> Interpreter stuff
@@ -87,6 +84,10 @@ public class Global {
public OutputStream printStream;
public final TreePrinter debugPrinter;
+ /** The set of currenttly compiled top-level symbols
+ */
+ public HashSet/*Symbol*/ compiledNow = new HashSet();
+
/** the current phase
*/
public PhaseDescriptor currentPhase;
@@ -280,8 +281,13 @@ public class Global {
if (currentPhase == PHASE.PARSER) fix1();
if (currentPhase == PHASE.ANALYZER) fix2();
}
- if (reporter.errors() != 0) imports.clear();
-
+ if (reporter.errors() != 0) {
+ imports.clear();
+ for (Iterator it = compiledNow.iterator(); it.hasNext();) {
+ uninitialize((Symbol)it.next());
+ }
+ }
+ compiledNow.clear();
printer.end();
}
// !!! <<< Interpreter stuff
@@ -623,4 +629,14 @@ public class Global {
reporter.inform("[" + message + " in " +
(System.currentTimeMillis() - start) + "ms]");
}
+
+ private void uninitialize(Symbol sym) {
+ if (sym instanceof ClassSymbol) {
+ ClassSymbol clazz = (ClassSymbol)sym;
+ if (clazz.sourcefile != null) {
+ clazz.reset(
+ new SourceCompleter(this, clazz.sourcefile));
+ }
+ }
+ }
}