JET-121 Extension closure scope, empty?

This commit is contained in:
Andrey Breslav
2011-06-23 20:30:21 +04:00
parent a850ca37aa
commit 3342515892
63 changed files with 3761 additions and 3496 deletions
@@ -0,0 +1,14 @@
namespace jet121 {
fun box() : String {
val answer = apply("OK") { String.() : Int =>
length
get(0)
}
return if (answer == 2) "OK" else "FAIL"
}
fun apply(arg:String, f : {String.() : Int}) : Int {
return arg.f()
}
}