diff options
author | Martin Odersky <odersky@gmail.com> | 2008-07-10 16:54:35 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2008-07-10 16:54:35 +0000 |
commit | 9dc05dc520c149d97877526d651d40d9c31214e3 (patch) | |
tree | d76aa3e9b76df3006e6460314b2707392e1c27e4 /src/compiler | |
parent | 79727b4ea3c4e672d2f9ce64a167de47e8006d15 (diff) | |
download | scala-9dc05dc520c149d97877526d651d40d9c31214e3.tar.gz scala-9dc05dc520c149d97877526d651d40d9c31214e3.tar.bz2 scala-9dc05dc520c149d97877526d651d40d9c31214e3.zip |
fixed #764 and #770
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Types.scala | 3 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/Mixin.scala | 14 |
2 files changed, 7 insertions, 10 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala index 5758676b8f..e4dbb2eb32 100644 --- a/src/compiler/scala/tools/nsc/symtab/Types.scala +++ b/src/compiler/scala/tools/nsc/symtab/Types.scala @@ -1082,7 +1082,8 @@ trait Types { while (j < clSize) { closureCache(j) match { case RefinedType(parents, decls) => - if (!decls.isEmpty) assert(false, "computing closure of "+this+":"+this.isInstanceOf[RefinedType]) + // can't assert decls.isEmpty; see t0764 + //if (!decls.isEmpty) assert(false, "computing closure of "+this+":"+this.isInstanceOf[RefinedType]+"/"+closureCache(j)) //Console.println("compute closure of "+this+" => glb("+parents+")") closureCache(j) = mergePrefixAndArgs(parents, -1, maxClosureDepth(parents) + LubGlbMargin) match { case Some(tp0) => tp0 diff --git a/src/compiler/scala/tools/nsc/transform/Mixin.scala b/src/compiler/scala/tools/nsc/transform/Mixin.scala index fd557911cf..59dd57e8fd 100644 --- a/src/compiler/scala/tools/nsc/transform/Mixin.scala +++ b/src/compiler/scala/tools/nsc/transform/Mixin.scala @@ -355,11 +355,6 @@ abstract class Mixin extends InfoTransform { /** The typer */ private var localTyper: erasure.Typer = _ - /** Within a static implementation method: the interface type corresponding - * to the implementation module; undefined evrywhere else. - */ - private var enclInterface: Symbol = _ - /** The first transform; called in a pre-order traversal at phase mixin * (that is, every node is processed before its children). * What transform does: @@ -389,7 +384,6 @@ abstract class Mixin extends InfoTransform { self = sym.newValue(sym.pos, nme.SELF) .setFlag(PARAM) .setInfo(toInterface(currentOwner.typeOfThis)); - enclInterface = currentOwner.toInterface val selfdef = ValDef(self) setType NoType copy.DefDef(tree, mods, name, tparams, List(selfdef :: vparams), tpt, rhs) } else { @@ -781,13 +775,15 @@ abstract class Mixin extends InfoTransform { case Select(Super(_, _), name) => tree - case Select(qual, name) if sym.owner.isImplClass && !isStaticOnly(sym) && enclInterface != null => + case Select(qual, name) if sym.owner.isImplClass && !isStaticOnly(sym) => // refer to fields in some implementation class via an abstract // getter in the interface. + if (sym.isMethod) assert(false, "no method allowed here: " + sym + sym.isImplOnly + " " + flagsToString(sym.flags)) - val getter = sym.getter(enclInterface) + val iface = toInterface(sym.owner.tpe).typeSymbol + val getter = sym.getter(iface) assert(getter != NoSymbol) localTyper.typed { atPos(tree.pos) { @@ -800,7 +796,7 @@ abstract class Mixin extends InfoTransform { // setter in the interface. localTyper.typed { atPos(tree.pos) { - Apply(Select(qual, lhs.symbol.setter(enclInterface)) setPos lhs.pos, List(rhs)) + Apply(Select(qual, lhs.symbol.setter(toInterface(lhs.symbol.owner.tpe).typeSymbol)) setPos lhs.pos, List(rhs)) } } case _ => |