Changes in new versions / Kotlin 1.7

// *** before: ***
// the type had to be written down, or the compiler asked for
// the -Xenable-builder-inference option
val listOld = buildList<Int> {
    add(1)
    add(2)
}

// *** in version 1.7: ***
val list = buildList {
    add(1)                 // the element type comes from the calls inside
    add(2)
}                          // List<Int>

val map = buildMap {
    put("a"1)
}                          // Map<String, Int>

fun main() {
    println(listOld)
    println(list.sum())
    println(map)
}