Files
kotlin/compiler/testData/codegen/box/controlStructures/kt513.kt
2016-11-21 18:20:33 +03:00

25 lines
410 B
Kotlin
Vendored

// WITH_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"
}