Fix nested classes codegen bug

When constructing a closure, codegen in some cases incorrectly determined if
it needed to store a reference from a nested class to the outer
This commit is contained in:
Alexander Udalov
2013-01-17 22:06:11 +04:00
parent 5c56900a09
commit c4a3963925
3 changed files with 26 additions and 8 deletions
@@ -0,0 +1,14 @@
fun foo(f: (Int) -> Int) = f(0)
class Outer {
class Nested {
val y = foo { a -> a }
}
fun bar(): String {
val a = Nested()
return "OK"
}
}
fun box() = Outer().bar()