Started playing the weekend with Kotlin and trying to get maps working with operators. Somehow Kotlin tells me I am confusing it with ambiguity.
Here is code that works (syntactically not like I want it to):
var columns = sortedMapOf("a" to 1, "b" to 2)
columns.plusAssign("c" to 3)
And here is code that simply does not compile (but syntactically closer to what I want)
var cs = sortedMapOf(1 to "a", 2 to "b")
cs += Pair(3, "c")
What shorthand operator magic/casting am I missing?
Thanks in advance.
columns.put("c", 3);codecs[4] = "f"cs[4] = "c"also won't allocate an aditional object.