I have tried all of the following for scala.collection.mutable.SortedSet:
var s = SortedSet[Array[Int]]
var s = SortedSet[Array[Int]]()
var s = new SortedSet[Array[Int]]
var s = new SortedSet[Array[Int]]()
var s = SortedSet[Array]
var s = SortedSet[Array]()
var s = new SortedSet[Array]()
I don't know why it has to be so hard to just declare this stuff in Scala. All I want is a sorted set of Int-arrays.
SortedSet
is not a "default" collection, therefore not defined inPredef
.First import it then it should work:
Next to this you need an implicit ordering defined:
Also be careful with
Array
-s as that is a Java array, so it does not have theequals
andhashcode
methods overridden and does not look at value equality, but rather reference equality.