Add addtional tests for builder inference
This commit is contained in:
Vendored
+33
@@ -0,0 +1,33 @@
|
||||
// !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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user