We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6f5023c commit f1a669bCopy full SHA for f1a669b
compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala
@@ -898,9 +898,9 @@ object PatternMatcher {
898
case Block(_, Match(_, cases)) => cases
899
case _ => Nil
900
}
901
- def numConsts(cdefs: List[CaseDef]) = {
+ def numConsts(cdefs: List[CaseDef]): Int = {
902
val tpes = cdefs.map(_.pat.tpe)
903
- tpes.toSet.size
+ tpes.toSet.size: Int // without the type ascription, testPickling fails because of #2840.
904
905
if (numConsts(resultCases) < numConsts(original.cases))
906
ctx.warning(i"could not emit switch for @switch annotated match", original.pos)
0 commit comments