Skip to content

Commit a15d967

Browse files
committed
Proper test for scala#4563.
1 parent bc7aeac commit a15d967

File tree

3 files changed

+22
-12
lines changed

3 files changed

+22
-12
lines changed

tests/pos/i4563.scala

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

tests/run/i4563.check

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Foo(10)
2+
Foo(42)
3+
Foo(10)

tests/run/i4563.scala

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
case class Foo(str: String) extends AnyVal
2+
3+
object Test {
4+
def main(args: Array[String]): Unit = {
5+
test(Foo("one"))
6+
test(Foo(""))
7+
test("two")
8+
}
9+
10+
def test(x: Any): Unit = {
11+
val vc: Any = x match {
12+
case Foo("") =>
13+
Foo("42")
14+
case _ =>
15+
Foo("10")
16+
}
17+
println(vc)
18+
}
19+
}

0 commit comments

Comments
 (0)