19 lines
377 B
Kotlin
Vendored
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"
|
|
}
|