c01c356817
Otherwise, R8 does not transform kotlin-reflect, failing bootstrap. Leaving end label the same is safe, since we do not remove labels during transformation.
23 lines
416 B
Kotlin
Vendored
23 lines
416 B
Kotlin
Vendored
// 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"
|
|
} |