Closed
Description
The following exemple no more accepted
type LeafElem[X] = X match {
case String => Char
case Array[t] => LeafElem[t]
case Iterable[t] => LeafElem[t]
case AnyVal => X
}
with the following error
-- Error: recursive.scala:11:7 -------------------------------------------------
11 | type LeafElem[X] = X match {
| ^
|illegal cyclic reference: match ... (caught cyclic reference) ... of |type LeafElem refers back to the type itself
Metadata
Metadata
Assignees
Labels
No labels