fix for KT-237
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
fun foreach(array: Array<Int>, action: fun(Int): Unit) {
|
||||
for (el in array) {
|
||||
action(el) //exception through compilation (see below)
|
||||
}
|
||||
}
|
||||
/*
|
||||
fun almostFilter(array: Array<Int>, action: fun(Int): Int) {
|
||||
for (el in array) {
|
||||
action(el)
|
||||
}
|
||||
}
|
||||
*/
|
||||
fun box() : String {
|
||||
val a = Array<Int> (3)
|
||||
a[0] = 0
|
||||
a[1] = 1
|
||||
a[2] = 2
|
||||
foreach(a, { (el : Int) : Unit => System.out?.println(el) })
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user