Merge pull request #7661 from martijnhoekstra/martijnhoekstra-patch-1

spec: fix LinkedList definition
This commit is contained in:
Adriaan Moors 2019-01-17 16:30:24 +01:00 committed by GitHub
commit 806557974b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -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 }
}
```