Skip to content

Commit

Permalink
Add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierBlanvillain committed Feb 18, 2021
1 parent 953de75 commit 1fb3271
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/pos/11463.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
type LeafElem[X] = X match
case String => Char
case Array[t] => LeafElem[t]
case Iterable[t] => LeafElem[t]
case AnyVal => X

def leafElem[X](x: X): LeafElem[X] = x match
case x: String => x.charAt(0)
case x: Array[t] => leafElem(x(9))
case x: Iterable[t] => leafElem(x.head)
case x: AnyVal => x

0 comments on commit 1fb3271

Please sign in to comment.