Expand default parameters conditions on inlining default function
#KT-14564 Fixed #KT-10848 Fixed #KT-12497 Fixed
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
// FILE: 1.kt
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user