diff options
author | Martin Odersky <odersky@gmail.com> | 2009-05-04 17:15:52 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2009-05-04 17:15:52 +0000 |
commit | 43e5b5c135f3461f7bf30c90057fc5f66cfa9332 (patch) | |
tree | 105aa97d23f8b1946aca9dc03c4fbea1264d095c | |
parent | e2dc065960d17def1c035dc1e7c07a14cd5104a2 (diff) | |
download | scala-43e5b5c135f3461f7bf30c90057fc5f66cfa9332.tar.gz scala-43e5b5c135f3461f7bf30c90057fc5f66cfa9332.tar.bz2 scala-43e5b5c135f3461f7bf30c90057fc5f66cfa9332.zip |
fixing what looks like a problem in ParallelMat...
fixing what looks like a problem in ParallelMatching
-rw-r--r-- | src/compiler/scala/tools/nsc/matching/ParallelMatching.scala | 10 |
1 files changed, 9 insertions, 1 deletions
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 { |