horse_badorties
08/26/2017, 12:32 PMclass 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?!yole
08/26/2017, 12:36 PMhorse_badorties
08/26/2017, 12:37 PMyole
08/26/2017, 12:38 PMhorse_badorties
08/26/2017, 12:39 PM