Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Dec 6, 2023

Conversation

spuun
Copy link
Member

@spuun spuun commented Nov 27, 2023

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.

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.
@spuun spuun requested a review from carlhoerberg November 27, 2023 13:53
@spuun
Copy link
Member Author

spuun commented Nov 27, 2023

I'll try cover things with more explicit specs.

@spuun spuun merged commit 515fd9e into main Dec 6, 2023
3 checks passed
@spuun spuun deleted the table-key-must-be-string branch December 6, 2023 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants