Domenic Denicola (2013-05-21T05:27:40.000Z)
github at esdiscuss.org (2013-07-12T02:27:20.729Z)
On May 21, 2013, at 1:23, "Anne van Kesteren" <annevk at annevk.nl> wrote: > On Tue, May 21, 2013 at 6:20 AM, Domenic Denicola <domenic at domenicdenicola.com> wrote: >> As long as the contract that `map.set(x, y); map.get(x) === y` works for any `x` and `y`, then you're probably fine. > > I think it would have to subclass those methods by using toString() on the argument passed. It seems that would still be Map-like though. Hmm, so that invariant wouldn't hold? I assume `has` would be similarly broken? Seems? not so Map like, besides perhaps having some operations with the same name as Map's. Relevant: [Liskov substitution principle](http://en.wikipedia.org/wiki/Liskov_substitution_principle)