Skip to content

Commit 1fb3271

Browse files
Add test case
1 parent 953de75 commit 1fb3271

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/pos/11463.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
type LeafElem[X] = X match
2+
case String => Char
3+
case Array[t] => LeafElem[t]
4+
case Iterable[t] => LeafElem[t]
5+
case AnyVal => X
6+
7+
def leafElem[X](x: X): LeafElem[X] = x match
8+
case x: String => x.charAt(0)
9+
case x: Array[t] => leafElem(x(9))
10+
case x: Iterable[t] => leafElem(x.head)
11+
case x: AnyVal => x

0 commit comments

Comments
 (0)