Files
kotlin-fork/compiler/testData/cfgVariablesWithStdLib/contracts/inlinedLambdaAlwaysThrows.kt
T
Dmitry Savvinov f487525a1d Effects: add cfg-tests on inlined lambdas
==========
Introduction of Effect System: 15/18
2017-10-12 11:55:26 +03:00

15 lines
290 B
Kotlin
Vendored

// LANGUAGE_VERSION: 1.3
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
}