Skip to content

Commit b8a23e9

Browse files
authored
Merge pull request #13581 from dotty-staging/fix-10349
Fix #10349: Add regression test
2 parents 034522e + ea0c0dd commit b8a23e9

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

tests/neg-custom-args/allow-deep-subtypes/9849.scala

Lines changed: 0 additions & 4 deletions
This file was deleted.

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)