test for already fixed KT-1726

This commit is contained in:
Dmitry Jemerov
2012-06-02 23:27:34 +02:00
parent 2020446412
commit 6e3c02b695
2 changed files with 20 additions and 0 deletions
@@ -0,0 +1,15 @@
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"
}