Closure and boxing return value

This commit is contained in:
Maxim Shafirov
2011-06-22 21:26:01 +04:00
parent 3619e411a7
commit 90038fda02
4 changed files with 18 additions and 1 deletions
@@ -0,0 +1,7 @@
fun box() : String {
return if (int_invoker( { 7 } ) == 7) "OK" else "fail"
}
fun int_invoker(gen : {() : Int}) : Int {
return gen()
}