cloudamqp / amq-protocol.cr

An AMQP 0.9.1 serialization library for Crystal
MIT License
10 stars 2 forks source link

Table#delete and Table#has_key? argument must be string #16

Closed spuun closed 11 months ago

spuun commented 11 months ago

In public methods key is typed as String, except for delete and has_key?. This will type key as String and adds deprecated method overloads that supports "any" key.

That any type was accepted as key in delete caused merge! with NamedTuple to break, because delete didn't delete old values because of a symbol-string comparison in delete always was false.

Since all methods except for delete and has_key? types key to String it's reasonable to do it in them as well.

spuun commented 11 months ago

I'll try cover things with more explicit specs.