Files
kotlin-fork/compiler/testData/codegen/box/inference/builderInference/kt45083.kt
T
2021-06-22 21:13:53 +03:00

20 lines
431 B
Kotlin
Vendored

// WITH_RUNTIME
// DONT_TARGET_EXACT_BACKEND: WASM
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"
}