Long time ago we defaulted all maps and sets to be linked because it was really confusing to loose order in many practical applications.
If you want a hashset for performance/memory reasons you can obtain it with hashSetOf()
or toHashSet()
functions.
You cannot change the default behavior of setOf
in the standard library, but if you really want, you can hide it with your own explicitly imported setOf
function (import my.utils.setOf
), though I wouldn’t recommend it as a long term solution.