Skip to content

Commit df83d08

Browse files
committed
Fix #9190: add test
1 parent c245d33 commit df83d08

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/patmat/i9190.scala

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
class Test {
2+
case object X; type X = X.type
3+
case object Y; type Y = Y.type
4+
5+
type XorY = X | Y
6+
7+
val testee1: XorY = X
8+
testee1 match {
9+
case value: XorY => println(value)
10+
}
11+
12+
val testee2: Tuple1[XorY] = Tuple1(X)
13+
testee2 match {
14+
case Tuple1(value: XorY) => println(value)
15+
}
16+
17+
type IntOrString = Int | String
18+
19+
val testee3: Tuple1[IntOrString] = Tuple1(42)
20+
testee3 match {
21+
case Tuple1(value: IntOrString) => println(value)
22+
}
23+
}

0 commit comments

Comments
 (0)