Skip to content

Commit d3f07fe

Browse files
Fix #10349: Add regression test
1 parent 2784596 commit d3f07fe

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/neg/10349.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)