Add addtional tests for builder inference

This commit is contained in:
Victor Petukhov
2021-05-11 17:17:49 +03:00
parent ecde5414dc
commit 0b37b2be6a
54 changed files with 962 additions and 173 deletions
@@ -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)
}
}