Hello, I’ve just started to play around with Scala studying the red book (Functional Programming in Scala, Paul Chiusano, Rúnar Bjarnason).

There is a `List`

example:

I’m sure I’m missing something very basic here.

On ListTest.scala I get the error `List.type doesn't take parameters.`

List.scala

```
sealed trait List[+A]
case object Nil extends List[Nothing]
case class Cons[A](head: A, tail: List[A]) extends List[A]
object List {
def sum(ints: List[Int]): Int = ints match {
case Nil => 0
case Cons(x,xs) => x + sum(xs)
}
}
ListTest.scala
object ListTest extends App {
val x = List(1,2,3,4,5) match {
case Cons(x, Cons(2, Cons(4,_))) => x
case Nil => 42
case Cons(x, Cons(y, Cons(3, Cons(4,_)))) => x+y
case Cons(h,t) => h + sum(t)
case _ => 101
}
}
```