// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect import kotlin.internal.contracts.* inline fun myRun(block: () -> Unit): Unit { contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } block() } fun test() { myRun { throw java.lang.IllegalArgumentException() } val x: Int = 42 }