Create a gist now

Instantly share code, notes, and snippets.

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