Files
kotlin-fork/compiler/testData/codegen/box/funInterface/inlinedSamWrapper.kt
T
Alexander Udalov 1071919706 Remove backend tests on old inference
Also remove any mentions of NewInference, and rename some tests.
2021-11-09 20:07:33 +01:00

28 lines
472 B
Kotlin
Vendored

// WITH_RUNTIME
fun interface MyRunnable {
fun invoke()
}
class A {
inline fun doWork(noinline job: () -> Unit) {
MyRunnable(job).invoke()
}
fun doNoninlineWork(job: () -> Unit) {
MyRunnable(job).invoke()
}
}
fun box(): String {
var result = false
A().doWork { result = true }
if (!result) return "Fail 1"
result = false
A().doNoninlineWork { result = true }
if (!result) return "Fail 2"
return "OK"
}