diff options
author | Martin Odersky <odersky@gmail.com> | 2004-03-26 13:35:11 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2004-03-26 13:35:11 +0000 |
commit | 13005976275b6f629b9cce2138df189a532f43c3 (patch) | |
tree | 474c767cd24487286e7bf6d384187778422477f8 /sources/scalac | |
parent | ae8b367bfe69cd28e1f07c628c713c52c5589c9b (diff) | |
download | scala-13005976275b6f629b9cce2138df189a532f43c3.tar.gz scala-13005976275b6f629b9cce2138df189a532f43c3.tar.bz2 scala-13005976275b6f629b9cce2138df189a532f43c3.zip |
*** empty log message ***
Diffstat (limited to 'sources/scalac')
-rw-r--r-- | sources/scalac/Global.java | 39 | ||||
-rw-r--r-- | sources/scalac/symtab/Modifiers.java | 1 | ||||
-rw-r--r-- | sources/scalac/symtab/Symbol.java | 3 | ||||
-rw-r--r-- | sources/scalac/symtab/Type.java | 2 |
4 files changed, 32 insertions, 13 deletions
diff --git a/sources/scalac/Global.java b/sources/scalac/Global.java index d2d0df060d..a45a1aeac8 100644 --- a/sources/scalac/Global.java +++ b/sources/scalac/Global.java @@ -122,16 +122,27 @@ public abstract class Global { */ public final Map/*<Symbol, String>*/ mapSymbolComment = new HashMap(); + /** views associated with (upper-bounded) type parameters + */ + public final Map/*<Symbol, Symbol>*/ viewOfTypeParam = new HashMap(); + + /** Pickled info of top-level symbols + */ public final Map/*<Symbol, Pickle>*/ symdata = new HashMap(); + /** The compiler command arguments */ public final CompilerCommand args; - /** The set of currenttly compiled top-level symbols + /** The set of currently compiled top-level symbols */ public HashMap/*<Symbol,Sourcefile>*/ compiledNow = new HashMap(); + /** The set of already compiled sourcefiles + */ + public HashSet/*<SourceFile>*/ compiledUnits = new HashSet(); + /** the current phase */ public Phase currentPhase; @@ -334,7 +345,9 @@ public abstract class Global { List units = new ArrayList(files.length); for (int i = 0; i < files.length; i++) { try { - units.add(new Unit(this, getSourceFile(files[i]), console)); + SourceFile source = getSourceFile(files[i]); + units.add(new Unit(this, source, console)); + compiledUnits.add(source); } catch (IOException exception) { error(exception.getMessage()); } @@ -353,6 +366,7 @@ public abstract class Global { public void compile(String filename, String input, boolean console) { reporter.resetCounters(); SourceFile source = getSourceFile(filename, input); + compiledUnits.add(source); units = new Unit[]{new Unit(this, source, console)}; compile(); } @@ -394,15 +408,18 @@ public abstract class Global { /** Compiles an additional source file. */ public void compileLate(SourceFile source, boolean mixinOnly) { - Unit unit = new Unit(this, source, false, mixinOnly); - Phase backup = currentPhase; - // !!! add code to print/skip/graph as in compile - currentPhase = PHASE.PARSER.phase(); - PHASE.PARSER.phase().apply(new Unit[] {unit}); - currentPhase = PHASE.ANALYZER.phase(); - ((AnalyzerPhase)PHASE.ANALYZER.phase()).lateEnter(unit); - // !!! add code for later phases? - currentPhase = backup; + if (!compiledUnits.contains(source)) { + compiledUnits.add(source); + Unit unit = new Unit(this, source, false, mixinOnly); + Phase backup = currentPhase; + // !!! add code to print/skip/graph as in compile + currentPhase = PHASE.PARSER.phase(); + PHASE.PARSER.phase().apply(new Unit[] {unit}); + currentPhase = PHASE.ANALYZER.phase(); + ((AnalyzerPhase)PHASE.ANALYZER.phase()).lateEnter(unit); + // !!! add code for later phases? + currentPhase = backup; + } } private void print() { diff --git a/sources/scalac/symtab/Modifiers.java b/sources/scalac/symtab/Modifiers.java index 22d7ed3e21..afe215ea3d 100644 --- a/sources/scalac/symtab/Modifiers.java +++ b/sources/scalac/symtab/Modifiers.java @@ -31,6 +31,7 @@ public interface Modifiers { int JAVA = 0x00001000; // symbol was defined by a Java class int MODUL = 0x00002000; // symbol is module or class implementing a module int MUTABLE = 0x00004000; // symbol is a mutable variable. + int VIEWBOUND = 0x00004000; // type symbol has a <+ bound. int PARAM = 0x00008000; // symbol is a (type) parameter to a method int INITIALIZED = 0x00010000; // symbol's definition is complete diff --git a/sources/scalac/symtab/Symbol.java b/sources/scalac/symtab/Symbol.java index 2df07c6b34..42a9606e91 100644 --- a/sources/scalac/symtab/Symbol.java +++ b/sources/scalac/symtab/Symbol.java @@ -1370,7 +1370,8 @@ public abstract class Symbol implements Modifiers, Kinds { if (owner.kind == CLASS && !owner.isAnonymousClass() && !owner.isCompoundSym() || Global.instance.debug) - return " in " + owner; + return " in " + + (owner.isModuleClass() ? ((ClassSymbol) owner).module() : owner); else return ""; } diff --git a/sources/scalac/symtab/Type.java b/sources/scalac/symtab/Type.java index 2c15e6a58c..7a1b8cb3db 100644 --- a/sources/scalac/symtab/Type.java +++ b/sources/scalac/symtab/Type.java @@ -3180,7 +3180,7 @@ public class Type implements Modifiers, Kinds, TypeTags, EntryTags { return UNBOXEDARRAYtpe ^ (elemtp.hashCode() * 41); default: - throw new ApplicationError(); + throw new ApplicationError("bad type for hashCode: " + this); } } |