Why this is exhaustive ``` fun <T> Tree<T...
# announcements
d
Why this is exhaustive
Copy code
fun <T> Tree<T>.nodes(): List<Node<T>> =
    when (this) {
        is Node<T> -> left.nodes() + right.nodes() + this
        is End        -> emptyList()
    }
but this is not
Copy code
fun <T> Tree<T>.nodes(): List<Node<T>> =
    when {
        this is Node<T> -> left.nodes() + right.nodes() + this
        this is End     -> emptyList()
        // kotlin wants `else` here
    }
?