From dc373d09bb53c606bf067e03f655cc404a313d41 Mon Sep 17 00:00:00 2001 From: Burak Emir Date: Tue, 7 Aug 2007 10:52:08 +0000 Subject: fixed #1213, added test case --- .../tools/nsc/matching/ParallelMatching.scala | 26 +++++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala index 5df7b3736d..bf7f777bfa 100644 --- a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala +++ b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala @@ -874,16 +874,27 @@ object Rep { */ val stpe = if (o.tpe.termSymbol.isModule) { - singleType(o.tpe.prefix, o.symbol) - } else - singleType(NoPrefix, o.symbol) - + singleType(o.tpe.prefix, o.symbol) + } else { + singleType(NoPrefix, o.symbol) // equals-check + } val p = Ident(nme.WILDCARD) setType stpe val q = Typed(p, TypeTree(stpe)) setType stpe pats = q::pats } else pats = o::pats + case o @ Select(_,_) => + val stpe = + if (o.tpe.termSymbol.isModule) { + singleType(o.tpe.prefix, o.symbol) + } else { + singleType(NoPrefix, o.symbol) // equals-check + } + val p = Ident(nme.WILDCARD) setType stpe + val q = Typed(p, TypeTree(stpe)) setType stpe + pats = q::pats + case ua @ UnApply(Apply(fn, _), arg) => fn.tpe match { case MethodType(List(argtpe,_*),_) => @@ -898,8 +909,10 @@ object Rep { //Console.println(o) //val stpe = singleType(NoPrefix, o.symbol) val stpe = - if (o.tpe./*?term?*/symbol.isModule) singleType(o.tpe.prefix, o.symbol) - else mkThisType(o.symbol) + if (o.tpe.termSymbol.isModule) singleType(o.tpe.prefix, o.symbol) + else { + singleType(NoPrefix, o.symbol) // equals-check + } val p = Ident(nme.WILDCARD) setType stpe val q = Typed(p, TypeTree(stpe)) setType stpe pats = q::pats @@ -1133,6 +1146,7 @@ object Rep { Equals(gen.mkAttributedRef(tpe.termSymbol), scrutineeTree) // object } else { //Console.print("111 ??") + //Console.println("tpe.prefix "+tpe.prefix) //Console.println("tpe stable "+tpe.isStable) //Console.println("tpe prefix stable "+tpe.prefix.isStable) //val x = Equals(Apply(gen.mkAttributedRef(tpe./*?term?*/symbol), List()), scrutineeTree) -- cgit v1.2.3