Files
kotlin-fork/compiler/testData/codegen/box/controlStructures/kt513.kt
T
2020-11-09 16:04:43 +03:00

30 lines
559 B
Kotlin
Vendored

// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: IGNORED_IN_JS
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// WITH_RUNTIME
// KJS_WITH_FULL_RUNTIME
class A() {
infix fun <T> ArrayList<T>.add3(el: T) = add(el)
fun test(list: ArrayList<Int>) {
for (i in 1..10) {
list add3 i
}
}
}
infix fun <T> ArrayList<T>.add2(el: T) = add(el)
fun box() : String{
var list = ArrayList<Int>()
for (i in 1..10) {
list.add(i)
list add2 i
}
A().test(list)
println(list)
return "OK"
}