[FIR2IR] Properly set isAssignable flag for parameters of tailrec functions
^KT-63973 Fixed
This commit is contained in:
committed by
Space Team
parent
f4e3203cd8
commit
28f0f1ea88
@@ -0,0 +1,19 @@
|
||||
// ISSUE: KT-63973
|
||||
// WITH_STDLIB
|
||||
|
||||
tailrec fun <T> foo(vararg items: String, fn: (String) -> T): T = when (items.size) {
|
||||
0 -> fn("")
|
||||
else -> foo(*items.drop(1).toTypedArray()) {
|
||||
fn(items.first())
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val result = buildString {
|
||||
foo("abcde") { append(it) }
|
||||
}
|
||||
if (result != "abcde") {
|
||||
return "Fail: $result"
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user