diff options
-rw-r--r-- | sources/scala/tools/nsc/Interpreter.scala | 2 | ||||
-rw-r--r-- | sources/scala/tools/nsc/ast/TreePrinters.scala | 3 | ||||
-rwxr-xr-x | sources/scala/tools/nsc/symtab/Symbols.scala | 10 | ||||
-rwxr-xr-x | sources/scala/tools/nsc/transform/Flatten.scala | 6 | ||||
-rwxr-xr-x | sources/scala/tools/nsc/transform/Mixin.scala | 3 | ||||
-rwxr-xr-x | sources/scala/tools/nsc/typechecker/RefChecks.scala | 2 |
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 |