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:
@@ -0,0 +1,7 @@
|
||||
fun foo(s: String): String {
|
||||
fun bar(count: Int): String =
|
||||
if (count == 0) s else bar(count - 1)
|
||||
return bar(239)
|
||||
}
|
||||
|
||||
fun box(): String = foo("OK")
|
||||
@@ -0,0 +1,7 @@
|
||||
fun box(): String {
|
||||
fun rmrf(i: Int) {
|
||||
if (i > 0) rmrf(i - 1)
|
||||
}
|
||||
rmrf(5)
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user