FIR CLI: initialize module and dependencies

#KT-42624 Fixed
This commit is contained in:
Jinseong Jeon
2020-10-13 22:40:22 -07:00
committed by Mikhail Glukhikh
parent 01ba1cded7
commit 4d28463f1a
2 changed files with 34 additions and 2 deletions
@@ -1,7 +1,7 @@
// WITH_RUNTIME
// KJS_WITH_FULL_RUNTIME
fun box(): String {
fun foo(): String {
val a = ArrayList<String>()
a.add("OK")
for (i in a.indices) {
@@ -9,3 +9,23 @@ fun box(): String {
}
return "Fail"
}
// KT-42642
fun bar(): String {
val a = ArrayList<String>()
a.add("O")
a.add("K")
val map = mutableMapOf<String, String>().apply {
for (i in a.indices step 2) {
put(a[i].toLowerCase(), a[i])
put(a[i + 1].toLowerCase(), a[i + 1])
}
}
return map.values.joinToString(separator = "")
}
fun box(): String {
val r = foo()
if (r != "OK") return r
return bar()
}