From 43e5b5c135f3461f7bf30c90057fc5f66cfa9332 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 4 May 2009 17:15:52 +0000 Subject: fixing what looks like a problem in ParallelMat... fixing what looks like a problem in ParallelMatching --- src/compiler/scala/tools/nsc/matching/ParallelMatching.scala | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala index 61172ff6a2..6a811b77c7 100644 --- a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala +++ b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala @@ -787,7 +787,15 @@ trait ParallelMatching { // `typeRef(definitions.ScalaPackageClass.tpe, definitions.EqualsPatternClass, List(stpe))' // and force an equality check. However, exhaustivity checking would not work anymore. // so first, extend exhaustivity check to equalspattern - def sType(o: Tree) = singleType(o.tpe.prefix, o.symbol) + + // Martin: I am not really sure what stype is doing, but it caused aliases.scala to fail + // The problem is if a val has a singleType of some other module. Then isModule is true and + // sType is called. But it ends up mixing the prefix of the other module with the val symbol + // which then causes erasure to be confused. + def sType(o: Tree) = o.tpe match { + case st @ SingleType(pre, sym) => st + case _ => singleType(o.tpe.prefix, o.symbol) + } def equalsCheck(o: Tree) = if (o.symbol.isValue) singleType(NoPrefix, o.symbol) else sType(o) def isModule(o: Tree) = o.symbol.isModule || o.tpe.termSymbol.isModule def applyType(o: Tree, fn: Tree): Type = fn match { -- cgit v1.2.3