Skip to content

Commit f1a669b

Browse files
committed
Avoid test-pickling failure.
1 parent 6f5023c commit f1a669b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -898,9 +898,9 @@ object PatternMatcher {
898898
case Block(_, Match(_, cases)) => cases
899899
case _ => Nil
900900
}
901-
def numConsts(cdefs: List[CaseDef]) = {
901+
def numConsts(cdefs: List[CaseDef]): Int = {
902902
val tpes = cdefs.map(_.pat.tpe)
903-
tpes.toSet.size
903+
tpes.toSet.size: Int // without the type ascription, testPickling fails because of #2840.
904904
}
905905
if (numConsts(resultCases) < numConsts(original.cases))
906906
ctx.warning(i"could not emit switch for @switch annotated match", original.pos)

0 commit comments

Comments
 (0)