GreatSyntacticShift: Codegen testdata fixed
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import java.util.*
|
||||
|
||||
fun <T> ArrayList<T>.findAll(predicate: fun (T) : Boolean): ArrayList<T> {
|
||||
fun <T> ArrayList<T>.findAll(predicate: (T) -> Boolean): ArrayList<T> {
|
||||
val result = ArrayList<T>()
|
||||
for(val t in this) {
|
||||
if (predicate(t)) result.add(t)
|
||||
@@ -16,6 +16,6 @@ fun box(): String {
|
||||
list.add("Moscow")
|
||||
list.add("Munich")
|
||||
|
||||
val m: ArrayList<String> = list.findAll<String>({(name: String) => name.startsWith("M")})
|
||||
val m: ArrayList<String> = list.findAll<String>({(name: String) -> name.startsWith("M")})
|
||||
return if (m.size() == 2) "OK" else "fail"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user