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
792 B
Kotlin
Vendored
34 lines
792 B
Kotlin
Vendored
// !LANGUAGE: +UnrestrictedBuilderInference
|
|
// WITH_STDLIB
|
|
|
|
interface A {
|
|
fun foo(): MutableList<String>
|
|
}
|
|
|
|
@ExperimentalStdlibApi
|
|
fun main() {
|
|
buildList {
|
|
add(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>3<!>)
|
|
object : A {
|
|
override fun foo(): MutableList<String> = this@buildList
|
|
}
|
|
}
|
|
buildList {
|
|
add(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>3<!>)
|
|
val x: String = get(0)
|
|
}
|
|
buildList {
|
|
add(<!TYPE_MISMATCH!>"3"<!>)
|
|
val x: MutableList<Int> = this@buildList
|
|
}
|
|
buildList {
|
|
val y: CharSequence = ""
|
|
add(<!TYPE_MISMATCH, TYPE_MISMATCH!>y<!>)
|
|
val x: MutableList<String> = this@buildList
|
|
}
|
|
buildList {
|
|
add(<!TYPE_MISMATCH!>""<!>)
|
|
val x: StringBuilder = get(0)
|
|
}
|
|
}
|