I don't understand why this works:
val romanNum = immutable.Map(1 -> "I", 2 -> "II", 3 -> "III", 4 -> "IV", 5 -> "V")
val romanNumWith10 = romanNum + (10 -> "X")
But this gives an error:
val romanNumWith10 = romanNum + (10, "X")
Both (10 -> "X") and (10, "X") return a Tuple2.
So both should work, but (10, "X") doesn't.
By the way, this works:
val romanNumWith10 = romanNum + ((10, "X"))
My Scala version is 3.1.2
It seems that Scala sees Int and String separately and not as a Tuple2, but why?