Files
kotlin-fork/compiler/testData/codegen/box/inference/builderInference/kt45083.kt
T
2021-10-02 06:14:35 +00:00

19 lines
396 B
Kotlin
Vendored

// WITH_RUNTIME
import kotlin.experimental.ExperimentalTypeInference
object Hello {
val hello = "hello"
}
@OptIn(ExperimentalTypeInference::class)
fun <E> buildList0(@BuilderInference builder: MutableList<E>.() -> Unit): List<E> = mutableListOf<E>().apply { builder() }
val numbers = buildList0 {
add(Hello.let { it::hello }.get())
}
fun box(): String {
numbers
return "OK"
}