c7435ba760
We are going to deprecate `WITH_RUNTIME` directive. The main reason behind this change is that `WITH_STDLIB` directive better describes its meaning, specifically it will add kotlin stdlib to test's classpath.
34 lines
796 B
Kotlin
Vendored
34 lines
796 B
Kotlin
Vendored
// !LANGUAGE: +UnrestrictedBuilderInference
|
|
// WITH_STDLIB
|
|
|
|
interface A {
|
|
fun foo(): MutableList<String>
|
|
}
|
|
|
|
@ExperimentalStdlibApi
|
|
fun main() {
|
|
buildList {
|
|
add(3)
|
|
object : A {
|
|
override fun foo(): MutableList<String> = <!RETURN_TYPE_MISMATCH!>this@buildList<!>
|
|
}
|
|
}
|
|
buildList {
|
|
add(3)
|
|
val x: String = <!INITIALIZER_TYPE_MISMATCH!>get(0)<!>
|
|
}
|
|
buildList {
|
|
add("3")
|
|
val x: MutableList<Int> = <!INITIALIZER_TYPE_MISMATCH!>this@buildList<!>
|
|
}
|
|
buildList {
|
|
val y: CharSequence = ""
|
|
add(y)
|
|
val x: MutableList<String> = <!INITIALIZER_TYPE_MISMATCH!>this@buildList<!>
|
|
}
|
|
buildList {
|
|
add("")
|
|
val x: StringBuilder = <!INITIALIZER_TYPE_MISMATCH!>get(0)<!>
|
|
}
|
|
}
|