Files
kotlin-fork/compiler/testData/codegen/boxError/semantic/unmatchedArguments.kt
T
Ilya Chernikov 78ca733c38 FIR JS: add K2 variants of all other JS tests
except tests that are not possible to add without some modifications in
the test infra. See todos on the commented-out test declarations
2022-11-12 16:28:24 +01:00

35 lines
556 B
Kotlin
Vendored

// IGNORE_ERRORS
// ERROR_POLICY: SEMANTIC
// IGNORE_BACKEND_K2: JS_IR
// MODULE: lib
// FILE: t.kt
var storage = ""
fun bar(a: String, b: String) { storage += a; storage += b; }
fun foo1() {
bar("O", "K")
bar("FAIL1")
}
fun foo2() {
bar("FAIL2", "FAIL2", "FAIL2", "FAIL2")
}
// MODULE: main(lib)
// FILE: b.kt
fun box(): String {
try {
foo1()
} catch (e: IllegalStateException) {
try {
foo2()
} catch (e: IllegalStateException) {
return storage
}
}
return "FAIL"
}