unwind

internal fun unwind()

End a suspended body: throw out of the yield it stopped at, so its finally blocks and use {} closes run. The body runs on the calling thread, as under hasNext, so call this where a step would run. One not yet started throws before its first line — right, since it opened nothing.

An Error, so catch (e: Exception) can't swallow it; told apart by identity, since only this frame has to recognize it coming back. One shot: a body that catches it and yields again stays abandoned. Any other throwable coming back — a failing close(), the guard cutting a long cleanup — is the caller's to report.