https://kotlinlang.org logo
Title
o

otakusenpai

01/20/2019, 1:31 PM
Hello, doesn't this line of code add a Pair to the mutable list?
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

Andrew S

01/20/2019, 3:55 PM
This works fine:
fun main(args: Array<String>) {  
    val list = mutableListOf<Pair<String,String>>()
	println(list)
	list.add(Pair("foo","bar"))
    println(list)
}