Fix for local closures

This commit is contained in:
Mikhael Bogdanov
2013-03-26 14:30:32 +04:00
parent 9091becbea
commit 932c1444a2
6 changed files with 67 additions and 1 deletions
@@ -0,0 +1,14 @@
fun box(): String {
fun local():Int {
return 10;
}
class A {
fun test(): Int {
return local()
}
}
return if (A().test() == 10) "OK" else "fail"
}
@@ -0,0 +1,12 @@
fun box(): String {
fun local():Int {
return 10;
}
class A {
val test = local()
}
return if (A().test == 10) "OK" else "fail"
}