summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sources/scalac/typechecker/Analyzer.java4
-rw-r--r--sources/scalac/typechecker/ImportList.java6
2 files changed, 10 insertions, 0 deletions
diff --git a/sources/scalac/typechecker/Analyzer.java b/sources/scalac/typechecker/Analyzer.java
index 0787403ce2..5cc9fc81b3 100644
--- a/sources/scalac/typechecker/Analyzer.java
+++ b/sources/scalac/typechecker/Analyzer.java
@@ -71,8 +71,10 @@ public class Analyzer extends Transformer implements Modifiers, Kinds {
assert this.unit == null : "start unit non null for " + unit;
this.unit = unit;
this.context = context;
+ ImportList prevImports = context.imports;
descr.contexts.put(unit, context);
enterSyms(unit.body);
+ context.imports = prevImports;
this.unit = null;
this.context = null;
}
@@ -982,6 +984,8 @@ public class Analyzer extends Transformer implements Modifiers, Kinds {
} catch (Type.Error ex) {
reportTypeError(tree.pos, ex);
tree.type = Type.ErrorType;
+ if (tree.hasSymbol()) tree.setSymbol(Symbol.ERROR);
+ return tree;
}
this.unit = savedUnit;
diff --git a/sources/scalac/typechecker/ImportList.java b/sources/scalac/typechecker/ImportList.java
index ba45996570..7f3e82c659 100644
--- a/sources/scalac/typechecker/ImportList.java
+++ b/sources/scalac/typechecker/ImportList.java
@@ -28,6 +28,12 @@ class ImportList {
this.prev = prev;
}
+ public String toString() {
+ String str = tree.symbol().toString();
+ if (prev != null) str = prev + "; " + str;
+ return str;
+ }
+
Tree importPrefix() {
switch (tree) {
case Import(Tree expr, _): return expr;