Files
kotlin-fork/compiler/testData/codegen/box/classes/kt1726.kt
T
Alexander Udalov 41a416da60 Move blackBoxFile() testData to box/ directory
Delete all test methods (and empty test classes), since they'll be
auto-generated
2013-01-28 18:20:17 +04:00

16 lines
284 B
Kotlin

class Foo(
var state : Int,
val f : (Int) -> Int){
fun next() : Int {
val nextState = f(state)
state = nextState
return state
}
}
fun box(): String {
val f = Foo(23, {x -> 2 * x})
return if (f.next() == 46) "OK" else "fail"
}