Hello, doesn't this line of code add a Pair to the...
# announcements
o
Hello, doesn't this line of code add a Pair to the mutable list?
Copy code
val list = mutableListOf<Pair<String,String>>()
....
list.add(Pair(foo,bar))
But in my case this doesn't add a new item to the list. All this is done inside a coroutinescope from a object of a class which has the above code.
a
This works fine:
Copy code
fun main(args: Array<String>) {  
    val list = mutableListOf<Pair<String,String>>()
	println(list)
	list.add(Pair("foo","bar"))
    println(list)
}