Skip to content

Instantly share code, notes, and snippets.

@s1monw1
Last active September 8, 2022 09:17
Show Gist options
  • Select an option

  • Save s1monw1/f2f0acc9b7ed5f50a9fbe20996fb2459 to your computer and use it in GitHub Desktop.

Select an option

Save s1monw1/f2f0acc9b7ed5f50a9fbe20996fb2459 to your computer and use it in GitHub Desktop.
public inline fun <T> T.apply(block: T.() -> Unit): T {
contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
}
block()
return this
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment