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.
2 parents 034522e + ea0c0dd commit b8a23e9Copy full SHA for b8a23e9
tests/neg-custom-args/allow-deep-subtypes/9849.scala
tests/neg/10349.scala
@@ -0,0 +1,11 @@
1
+object Firsts:
2
+
3
+ type First[X] = X match
4
+ case Map[_, v] => First[Option[v]]
5
6
+ def first[X](x: X): First[X] = x match
7
+ case x: Map[_, _] => first(x.values.headOption) // error
8
9
+ @main
10
+ def runFirsts2(): Unit =
11
+ assert(first(Map.empty[Int, Int]) == None) // error
0 commit comments