Files
kotlin-fork/compiler/testData/codegen/box/inlineArgsInPlace/kotlinReflect.kt
T
2021-10-01 17:18:49 +03:00

22 lines
392 B
Kotlin
Vendored

// FULL_JDK
// WITH_RUNTIME
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"
}