<Why is my kotlin hash set not adding elements> I ...
# stackoverflow
u
Why is my kotlin hash set not adding elements I am new to kotlin and I want to make an abstract/open class or interface, something that can be implemented by other classes. Let's call it Test. Now Test needs to have a HashSet (the docs say it requires less memory than a normal set) that every derived class will implement and fill with its own values. interface Test { val players: HashSet } class Supa: Test { override val players = hashSetOf() fun later() { players.add("new player") } } fun main() {...