diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/matching/ParallelMatching.scala | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala index a49984a4de..f28690ccba 100644 --- a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala +++ b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala @@ -317,9 +317,12 @@ trait ParallelMatching requires (transform.ExplicitOuter with PatternMatchers wi val allcomb = combine(sealedCols zip sealedComb) //Console.println("all comb!" + allcomb) - // returns true if pattern vector covers all type symbols + /** returns true if pattern vector pats covers a type symbols "combination" + * @param pats pattern vector + * @param comb pairs of (column index, type symbol) + */ def covers(pats: List[Tree], comb:List[(Int,Symbol)]) = { - comb forall { case (i,sym) => pats(i).tpe.symbol == sym } + comb forall { case (i,sym) => val p = pats(i); p.tpe.symbol == sym || sym.tpe <:< p.tpe } } val coversAll = allcomb forall { combination => row exists { r => covers(r._1, combination)}} //Console.println("all combinations covered? "+coversAll) |