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 c917cf8 commit cd79513Copy full SHA for cd79513
compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala
@@ -969,7 +969,7 @@ object PatternMatcher {
969
}
970
def numConsts(cdefs: List[CaseDef]): Int = {
971
val tpes = cdefs.map(_.pat.tpe)
972
- tpes.toSet.size: Int // without the type ascription, testPickling fails because of #2840.
+ tpes.toSet.size
973
974
if (numConsts(resultCases) < numConsts(original.cases))
975
ctx.warning(UnableToEmitSwitch(), original.pos)
tests/pickling/i2840.scala
@@ -0,0 +1,8 @@
1
+object Test {
2
+ class Type
3
+ def f(x: Type): Type = ???
4
+ def g(xs: List[Type]): Int = {
5
+ val ys = xs.map(f)
6
+ ys.toSet.size
7
+ }
8
+}
0 commit comments