summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2005-10-04 10:52:41 +0000
committerMartin Odersky <odersky@gmail.com>2005-10-04 10:52:41 +0000
commitc1f0a81530c914b9ba8966b9d2efd233379dab27 (patch)
treefd1992c43c57cdd94660a8e790171f237e1f62ff
parent22a82cff386193731b0cc89b6ece0f66b8742995 (diff)
downloadscala-c1f0a81530c914b9ba8966b9d2efd233379dab27.tar.gz
scala-c1f0a81530c914b9ba8966b9d2efd233379dab27.tar.bz2
scala-c1f0a81530c914b9ba8966b9d2efd233379dab27.zip
*** empty log message ***
-rw-r--r--sources/scala/tools/nsc/Interpreter.scala2
-rw-r--r--sources/scala/tools/nsc/ast/TreePrinters.scala3
-rwxr-xr-xsources/scala/tools/nsc/symtab/Symbols.scala10
-rwxr-xr-xsources/scala/tools/nsc/transform/Flatten.scala6
-rwxr-xr-xsources/scala/tools/nsc/transform/Mixin.scala3
-rwxr-xr-xsources/scala/tools/nsc/typechecker/RefChecks.scala2
6 files changed, 15 insertions, 11 deletions
diff --git a/sources/scala/tools/nsc/Interpreter.scala b/sources/scala/tools/nsc/Interpreter.scala
index c87fa66917..f5d215888a 100644
--- a/sources/scala/tools/nsc/Interpreter.scala
+++ b/sources/scala/tools/nsc/Interpreter.scala
@@ -47,7 +47,7 @@ abstract class Interpreter {
// first phase: compile auto-generated file
val args = List.fromString(filename, ' ');
val command = new CompilerCommand(args, error, true);
- compiler.currentRun.compile(command.files);
+ (new compiler.Run).compile(command.files);
/*
//todo: if no errors in compilation then
diff --git a/sources/scala/tools/nsc/ast/TreePrinters.scala b/sources/scala/tools/nsc/ast/TreePrinters.scala
index f8891766ed..c7d02e447f 100644
--- a/sources/scala/tools/nsc/ast/TreePrinters.scala
+++ b/sources/scala/tools/nsc/ast/TreePrinters.scala
@@ -216,7 +216,8 @@ abstract class TreePrinters {
case Super(qual, mixin) =>
if (qual != nme.EMPTY.toTypeName) print(symName(tree, qual) + ".");
print("super");
- if (mixin != nme.EMPTY.toTypeName) print("[" + mixin + "]")
+ if (mixin != nme.EMPTY.toTypeName)
+ print("[" + mixin + "]")
case This(qual) =>
if (qual != nme.EMPTY.toTypeName) print(symName(tree, qual) + ".");
diff --git a/sources/scala/tools/nsc/symtab/Symbols.scala b/sources/scala/tools/nsc/symtab/Symbols.scala
index f4459cd4d8..959b6cc31a 100755
--- a/sources/scala/tools/nsc/symtab/Symbols.scala
+++ b/sources/scala/tools/nsc/symtab/Symbols.scala
@@ -293,8 +293,14 @@ import Flags._;
/** Set initial info. */
def setInfo(info: Type): this.type = {
assert(info != null);
- infos = new TypeHistory(phase.id, info, null);
- limit = phase.id;
+ var pid = phase.id;
+ if (pid == 0) {
+ // can happen when we initialize NoSymbol before running the compiler
+ assert(name == nme.NOSYMBOL);
+ pid = 1
+ }
+ infos = new TypeHistory(pid, info, null);
+ limit = pid;
if (info.isComplete) {
rawflags = rawflags & ~LOCKED;
validForRun = currentRun
diff --git a/sources/scala/tools/nsc/transform/Flatten.scala b/sources/scala/tools/nsc/transform/Flatten.scala
index 6632e50e09..b8e7db3e5f 100755
--- a/sources/scala/tools/nsc/transform/Flatten.scala
+++ b/sources/scala/tools/nsc/transform/Flatten.scala
@@ -87,12 +87,6 @@ abstract class Flatten extends InfoTransform {
case ClassDef(_, _, _, _, _) if sym.isNestedClass =>
liftedDefs(sym.toplevelClass.owner) += tree;
EmptyTree
- case Super(qual, mix) if (mix != nme.EMPTY.toTypeName) =>
- val ps = tree.symbol.info.parents dropWhile (p => p.symbol.name != mix);
- assert(!ps.isEmpty, tree);
- val mix1 = if (ps.head.symbol.isNestedClass) atPhase(phase.next)(ps.head.symbol.name)
- else mix;
- copy.Super(tree, qual, mix1)
case Select(qual, name) if (sym.isStaticModule && !sym.owner.isPackageClass) =>
atPhase(phase.next) {
atPos(tree.pos) {
diff --git a/sources/scala/tools/nsc/transform/Mixin.scala b/sources/scala/tools/nsc/transform/Mixin.scala
index 90e55f77de..1c88f8c66c 100755
--- a/sources/scala/tools/nsc/transform/Mixin.scala
+++ b/sources/scala/tools/nsc/transform/Mixin.scala
@@ -363,6 +363,9 @@ abstract class Mixin extends InfoTransform {
Apply(Select(qual, lhs.symbol.setter(enclInterface)) setPos lhs.pos, List(rhs))
}
}
+ case TypeApply(fn, List(arg)) =>
+ if (arg.tpe.symbol.isImplClass) arg.tpe = toInterface(arg.tpe);
+ tree
case _ =>
tree
}
diff --git a/sources/scala/tools/nsc/typechecker/RefChecks.scala b/sources/scala/tools/nsc/typechecker/RefChecks.scala
index 376ae0b09c..58e88f69da 100755
--- a/sources/scala/tools/nsc/typechecker/RefChecks.scala
+++ b/sources/scala/tools/nsc/typechecker/RefChecks.scala
@@ -552,7 +552,7 @@ abstract class RefChecks extends InfoTransform {
unit.error(tree.pos, "symbol accessed from super may not be abstract");
}
//System.out.println("super: " + tree + " in " + base);//DEBUG
- if (base.isTrait && mixin == nme.EMPTY.toTypeName) {
+ if (base.isTrait && sym.isTerm && mixin == nme.EMPTY.toTypeName) {
val superAccName = nme.superName(sym.name);
val superAcc = base.info.decl(superAccName) suchThat (.alias.==(sym));
assert(superAcc != NoSymbol, "" + sym + " " + base + " " + superAccName);//debug