Instantly share code, notes, and snippets.

Embed
What would you like to do?
public inline fun <R> run(block: () -> R): R {
contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
}
return block()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment