diff --git a/spec/05-classes-and-objects.md b/spec/05-classes-and-objects.md index 80e7effd76..dd6ec10f77 100644 --- a/spec/05-classes-and-objects.md +++ b/spec/05-classes-and-objects.md @@ -824,11 +824,10 @@ Consider the class definition ```scala class LinkedList[A]() { - var head = _ - var tail = null - def isEmpty = tail != null + var head: A = _ + var tail: LinkedList[A] = null def this(head: A) = { this(); this.head = head } - def this(head: A, tail: List[A]) = { this(head); this.tail = tail } + def this(head: A, tail: LinkedList[A]) = { this(head); this.tail = tail } } ```