Do not extend LVT ranges during inplace arguments inlining

Otherwise, R8 does not transform kotlin-reflect, failing bootstrap.
Leaving end label the same is safe, since we do not remove labels during
transformation.
This commit is contained in:
Ilmir Usmanov
2021-08-22 07:51:24 +02:00
committed by Space
parent 92e94a4068
commit c01c356817
10 changed files with 68 additions and 29 deletions
@@ -0,0 +1,23 @@
// FULL_JDK
// WITH_RUNTIME
// IGNORE_BACKEND: WASM
interface Foo {
val foos: List<Foo>
}
inline fun <reified T : Any> Sequence<*>.firstIsInstanceOrNull(): T? {
for (element in this) if (element is T) return element
return null
}
fun faultyLvt() {
sequenceOf<Foo>().firstIsInstanceOrNull<Foo>()?.foos.orEmpty()
listOf<Foo>().map { it }
}
fun box(): String {
faultyLvt()
return "OK"
}