I’ve tried to freeze a Set instance, and it turned out not working:
irb(main):001:0> require ‘set’
=> true
irb(main):002:0> x = Set.new [“a”, “b”, “c”]
=> #<Set: {“a”, “b”, “c”}>
irb(main):003:0> x
=> #<Set: {“a”, “b”, “c”}>
irb(main):004:0> x.freeze
=> #<Set: {“a”, “b”, “c”}>
irb(main):005:0> x << “d”
=> #<Set: {“a”, “b”, “c”, “d”}>
Is this a bug, or it works as designed?