mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
25 lines
476 B
Kotlin
Vendored
25 lines
476 B
Kotlin
Vendored
// IGNORE_BACKEND: JVM_IR
|
|
|
|
import kotlin.contracts.ExperimentalContracts
|
|
import kotlin.contracts.InvocationKind
|
|
import kotlin.contracts.contract
|
|
|
|
@ExperimentalContracts
|
|
fun test(): Char {
|
|
val c: Char
|
|
doIt {
|
|
c = ' '
|
|
}
|
|
return c
|
|
}
|
|
|
|
@ExperimentalContracts
|
|
fun doIt(block: () -> Unit) {
|
|
contract {
|
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
|
}
|
|
block()
|
|
}
|
|
|
|
// 0 ISTORE 0
|
|
// 1 LOCALVARIABLE c Lkotlin/jvm/internal/Ref\$CharRef; L1 L3 0 |