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

Do not inherit from Hash in the compiler #11707

Merged

Conversation

HertzDevil
Copy link
Contributor

@HertzDevil HertzDevil commented Jan 6, 2022

Crystal::HashStringType inherits from Hash(String, Type) and overrides only to_json. The same can be achieved with a converter, and JSON::Serializable properly handles the case where Crystal::ContextResult#contexts is nil.

I am honestly surprised the compiler didn't break before because of this.

@straight-shoota straight-shoota added this to the 1.4.0 milestone Jan 6, 2022
@straight-shoota straight-shoota merged commit b48f3a5 into crystal-lang:master Jan 21, 2022
@HertzDevil HertzDevil deleted the refactor/crystal-hashstringtype branch January 23, 2022 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants