Files
kotlin-fork/compiler/testData/codegen/box/inference/builderInference/kt45083.kt
T
2022-06-21 15:01:56 +02:00

19 lines
377 B
Kotlin
Vendored

// WITH_STDLIB
import kotlin.experimental.ExperimentalTypeInference
object Hello {
val hello = "hello"
}
@OptIn(ExperimentalTypeInference::class)
fun <E> buildList0(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"
}