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 2784596 commit d3f07feCopy full SHA for d3f07fe
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