Skip to content

Commit 3fa491a

Browse files
committed
Add test t10373
1 parent f1809bd commit 3fa491a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/patmat/t10373.scala

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
abstract class Foo {
2+
def bar(): Unit = this match {
3+
case Foo_1() => //do something
4+
case Foo_2() => //do something
5+
// Works fine
6+
}
7+
8+
def baz(that: Foo): Unit = (this, that) match {
9+
case (Foo_1(), _) => //do something
10+
case (Foo_2(), _) => //do something
11+
// match may not be exhaustive
12+
}
13+
}
14+
case class Foo_1() extends Foo
15+
case class Foo_2() extends Foo

0 commit comments

Comments
 (0)