blob: 922f0294f533ad544d3da58027ee17483ca795fa [file]
// IGNORE_BACKEND: JS_IR, JS_IR_ES6, WASM_JS, WASM_WASI, NATIVE
// IGNORE_BACKEND_K2: JVM_IR
// WASM_MUTE_REASON: IGNORED_IN_JS
// IGNORE_IR_DESERIALIZATION_TEST: NATIVE
// FIR status: don't support legacy feature. UNINITIALIZED_PARAMETER y. See KT-49800
// IGNORE_IR_DESERIALIZATION_TEST: JS_IR
// ^^^ Source code is not compiled in JS.
// LANGUAGE: -ProhibitIllegalValueParameterUsageInDefaultArguments
fun f(
f1: () -> String = { f2() },
f2: () -> String = { "Fail: should not be called" }
): String = f1()
fun box(): String {
try {
f()
return "Fail: f() should have thrown NPE"
} catch (e : Exception) {
}
return f(f2 = { "O" }) + f(f1 = { "K" })
}