You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classNode {
val children :List<Node> = emptyList()
}
fun Node.subtree() = kotlin.coroutines.experimental.buildSequence {
val me =this@subtree
yield(me)
//me.children.forEach { yieldAll(it.subtree()) }for(child in me.children) {
for (ancestor in child.subtree())
yield(ancestor)
}
}
The commented code fails to compile with "No resolved code for yieldAll" generator exception
Uncommented code with recursive type dependency error.
Can i somehow get it working? #7 issue is probably related.
The text was updated successfully, but these errors were encountered:
Hm... works for me in the laters version of Kotlin. Anyway, if you are running it recursive type problem, you should just specify type explicitly. In this case you can either use buildSequence<Node> or add type annotation to the function fun Node.subtree(): Sequence<Node>
The commented code fails to compile with "No resolved code for yieldAll" generator exception
Uncommented code with recursive type dependency error.
Can i somehow get it working?
#7 issue is probably related.
The text was updated successfully, but these errors were encountered: