Files
kotlin-fork/compiler/testData/codegen/boxInline/defaultValues/kt14564.kt
T
2021-02-02 17:53:52 +03:00

37 lines
596 B
Kotlin
Vendored

// NO_CHECK_LAMBDA_INLINING
// FILE: 1.kt
package test
object TimeUtil {
inline fun waitForEx(retryWait: Int = 200,
action: () -> Boolean) {
var now = 1L
if (now++ <= 3) {
action()
}
}
}
// FILE: 2.kt
import test.*
var result = "fail"
fun box(): String {
TimeUtil.waitForEx(
action = {
try {
result = "OK"
true
}
catch (t: Throwable) {
false
}
})
return result
}