33 lines
635 B
Kotlin
Vendored
33 lines
635 B
Kotlin
Vendored
// !LANGUAGE: +StableBuilderInference
|
|
// WITH_RUNTIME
|
|
|
|
interface A {
|
|
fun foo(): MutableList<String>
|
|
}
|
|
|
|
@ExperimentalStdlibApi
|
|
fun main() {
|
|
buildList {
|
|
add(3)
|
|
object : A {
|
|
override fun foo(): MutableList<String> = this@buildList
|
|
}
|
|
}
|
|
buildList {
|
|
add(3)
|
|
val x: String = get(0)
|
|
}
|
|
buildList {
|
|
add("3")
|
|
val x: MutableList<Int> = this@buildList
|
|
}
|
|
buildList {
|
|
val y: CharSequence = ""
|
|
add(y)
|
|
val x: MutableList<String> = this@buildList
|
|
}
|
|
buildList {
|
|
add("")
|
|
val x: StringBuilder = get(0)
|
|
}
|
|
} |