blob: 323a5587c1a380c911fe6c0332347f86902291ae (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
|
enum class List[+T]
object List {
case Cons(x: T, xs: List[T])
case Nil
}
object Test {
import List._
val xs = Cons(1, Cons(2, Cons(3, Nil)))
def main(args: Array[String]) = println(xs)
}
|