KT-2280 Recursive function declared in function results in VerifyError

#KT-2280 Fixed

A closure's constructor should not take an instance of itself as an
argument, because it would require caller to pass yet uninitialized
value. Instead it should initialize a corresponding field with 'this'
This commit is contained in:
Alexander Udalov
2012-07-31 19:05:38 +04:00
parent b883bf6ef5
commit dcd5cad427
5 changed files with 44 additions and 2 deletions
@@ -0,0 +1,7 @@
fun box(): String {
fun rmrf(i: Int) {
if (i > 0) rmrf(i - 1)
}
rmrf(5)
return "OK"
}