```class Node(val nodes: List<Node>) fun pr...
# intellij
h
Copy code
class Node(val nodes: List<Node>)

fun preOrder(node: Node) = node.nodes.forEach {
    // ...
    preOrder(it)
}
does not compile using kotlin version 1.1.4-2 due to
Type checking has run into a recursive problem. Easiest workaround: specify types of your declarations explicitly
It compiles using
fun preOrder(node: Node): Unit = ...
but then there is a
Redundant 'Unit' return type
warning?!
y
you should simply convert this to a block body
h
yes, that's what I have done. I post it here because the warning might just be wrong in this case, no?
y
yes, it kind of is, but it's too difficult to detect that it's wrong
h
fair enough