diff options
author | Burak Emir <emir@epfl.ch> | 2006-09-13 14:59:23 +0000 |
---|---|---|
committer | Burak Emir <emir@epfl.ch> | 2006-09-13 14:59:23 +0000 |
commit | 2e012097421017bb37f13bb78dbe1a4ace271641 (patch) | |
tree | b1854e5fd3aff2c8604eb93465bd0db8a07634c2 /src | |
parent | 3f64a5e88ede584696581dd363837006b0666a0e (diff) | |
download | scala-2e012097421017bb37f13bb78dbe1a4ace271641.tar.gz scala-2e012097421017bb37f13bb78dbe1a4ace271641.tar.bz2 scala-2e012097421017bb37f13bb78dbe1a4ace271641.zip |
reenabled outer
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/matching/PatternMatchers.scala | 11 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala | 8 |
2 files changed, 14 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/matching/PatternMatchers.scala b/src/compiler/scala/tools/nsc/matching/PatternMatchers.scala index d7ec803ac6..c2c315d0f6 100644 --- a/src/compiler/scala/tools/nsc/matching/PatternMatchers.scala +++ b/src/compiler/scala/tools/nsc/matching/PatternMatchers.scala @@ -1173,17 +1173,24 @@ trait PatternMatchers requires (transform.ExplicitOuter with PatternNodes) { if(!outerAlwaysEqual(casted.tpe, selector.tpe)) { casted.tpe match { case TypeRef(prefix,_,_) if (prefix.symbol.isTerm && !prefix.symbol.isPackage) => + //var theRef = gen.mkAttributedRef(prefix.symbol) // needs explicitouter treatment var theRef = gen.mkAttributedRef(prefix.prefix, prefix.symbol) // needs explicitouter treatment if(global.settings.debug.value) { Console.println("theRef "+theRef) + Console.println("handleOuter(theRef) "+handleOuter(theRef)) + Console.println("casted.expandedName "+casted.tpe.symbol.expandedName(nme.OUTER)) + Console.println("prefix.expandedName "+prefix.symbol.expandedName(nme.OUTER)) + Console.println("prefix.prefix.expandedName "+prefix.prefix.symbol.expandedName(nme.OUTER)) } theRef = handleOuter(theRef) - if(node.getTpe().decls.lookup(nme.OUTER) != NoSymbol) { // some guys don't have outers + val outername = casted.tpe.symbol.expandedName(nme.OUTER) + + if(node.getTpe().decls.lookup(outername) != NoSymbol) { // some guys don't have outers cond = And(cond, Eq(Apply(Select( - gen.mkAsInstanceOf(selector.duplicate, node.getTpe(), true), nme.OUTER),List()), theRef)) + gen.mkAsInstanceOf(selector.duplicate, node.getTpe(), true), outername),List()), theRef)) } case _ => //ignore ; diff --git a/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala b/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala index 24092309cb..2dd32c1641 100644 --- a/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala +++ b/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala @@ -319,9 +319,11 @@ abstract class ExplicitOuter extends InfoTransform with TransMatcher with Patter super.transform(copy.Apply(tree, sel, outerVal :: args)) case Match(selector, cases) => // <----- transmatch hook - val tid = unit.fresh.newName("tidmark") - if (settings.debug.value) - Console.println("transforming patmat with tidmark "+tid+" ncases = "+cases.length) + val tid = if (settings.debug.value) { + val q = unit.fresh.newName("tidmark") + Console.println("transforming patmat with tidmark "+q+" ncases = "+cases.length) + q + } else null if ((cases.length > 1) && (treeInfo.isDefaultCase(cases(0)))) assert(false,"transforming too much, " + tid) |