notClosed

inline fun <R> notClosed(crossinline lazyMessage: () -> String = { "Scope is closed" }, block: () -> R): R(source)

Returns block's result or throws IllegalStateException if closed is true.