summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2004-11-18 09:23:44 +0000
committerpaltherr <paltherr@epfl.ch>2004-11-18 09:23:44 +0000
commitd34f1616780676f1f90dd3e536a5d5cfb43f20a7 (patch)
tree3f89a27e4b1f7a94cbb66f3bb63db814047ea3c9 /sources
parent86dd00a81c53cf737590ccd02764d95aa42a2670 (diff)
downloadscala-d34f1616780676f1f90dd3e536a5d5cfb43f20a7.tar.gz
scala-d34f1616780676f1f90dd3e536a5d5cfb43f20a7.tar.bz2
scala-d34f1616780676f1f90dd3e536a5d5cfb43f20a7.zip
- Added code to force loading of source of clas...
- Added code to force loading of source of classes Function*
Diffstat (limited to 'sources')
-rw-r--r--sources/scala/tools/scalac/typechecker/Analyzer.scala17
1 files changed, 17 insertions, 0 deletions
diff --git a/sources/scala/tools/scalac/typechecker/Analyzer.scala b/sources/scala/tools/scalac/typechecker/Analyzer.scala
index 4bd10404ec..3cc95814b0 100644
--- a/sources/scala/tools/scalac/typechecker/Analyzer.scala
+++ b/sources/scala/tools/scalac/typechecker/Analyzer.scala
@@ -65,6 +65,9 @@ class Analyzer(global: scalac_Global, descr: AnalyzerPhase) extends Transformer(
i = i + 1
}
super.apply(units);
+ val mixinOnly = global.target != Global.TARGET_INT;
+ List.range(0, definitions.FUNCTION_COUNT).foreach(
+ i => loadCode(definitions.FUNCTION_CLASS(i), mixinOnly));
var n = descr.newSources.size();
while (n > 0) { // this calls apply(u) for every unit `u'.
val l = global.units.length;
@@ -122,6 +125,20 @@ class Analyzer(global: scalac_Global, descr: AnalyzerPhase) extends Transformer(
}
}
+ def loadCode(clasz: Symbol, mixinOnly: boolean): unit = {
+ assert(clasz.isClass() && !clasz.isModuleClass(), Debug.show(clasz));
+ if (clasz.isExternal()) {
+ try {
+ global.compileLate(global.getSourceFile(clasz), mixinOnly);
+ } catch {
+ case exception: java.io.IOException =>
+ if (global.debug) exception.printStackTrace();
+ global.error(exception.getMessage() + "; source file for "
+ + clasz + " is needed");
+ }
+ }
+ }
+
override def apply(unit: CompilationUnit): unit = {
global.log("checking " + unit);
assert(this.unit == null, "start unit non null for " + unit);