Replace SourceInterpreter with interpreter, which track only
functional arguments.
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
// FILE: 1.kt
|
||||
fun check1() = true
|
||||
|
||||
fun check2() = false
|
||||
|
||||
inline fun inlineMe1(fn: (String, String) -> String): String {
|
||||
return fn(if (check1()) return "O" else "1", return "2")
|
||||
}
|
||||
|
||||
inline fun inlineMe2(fn: (String) -> String): String {
|
||||
return fn(if (check2()) return "3" else "K")
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
fun box() = inlineMe1 { _, _ -> "FAIL1" } + inlineMe2 { it }
|
||||
@@ -0,0 +1,10 @@
|
||||
// FILE: 1.kt
|
||||
inline fun alwaysOk(s: String, fn: (String) -> String): String {
|
||||
return fn(try {return "OK"} catch (e: Exception) {
|
||||
"fail1"
|
||||
}) + fn(try {return "FF"} catch (e: Exception) {
|
||||
"fail2"
|
||||
})
|
||||
}
|
||||
// FILE: 2.kt
|
||||
fun box() = alwaysOk("what?") { it }
|
||||
Reference in New Issue
Block a user