scala> val set = scala.collection.mutable.Set[(Int, Int)]()
set: scala.collection.mutable.Set[(Int, Int)] = Set()
scala> set += (3, 4)
<console>:9: error: type mismatch;
found : Int(3)
required: (Int, Int)
set += (3, 4)
^
scala> set += Tuple2(3, 4)
res5: set.type = Set((3,4))
Добавление (3, 4)
не работает -почему ?
Обычно (3, 4)
также представляет кортеж из двух элементов.