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

Avoid compile-time error on empty NamedTuples. #12007

Merged

Conversation

I3oris
Copy link
Contributor

@I3oris I3oris commented Apr 18, 2022

Fix #12006.
This PR replaces the curly brackets by NamedTuple.new in order to avoid compile-time errors on empty named tuples for the functions NamedTuple#merge, NamedTuple#clone, NamedTuple#new(pull : JSON::PullParser), and NamedTuple.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node).

This is my first PR :), so tell me if I did anything wrong, if the fix is acceptable/wanted or if the spec are fine.

… to avoid compile-time errors on empty named tuples for the functions `NamedTuple#merge`, `NamedTuple#clone`, `NamedTuple#new(pull : JSON::PullParser)`, and `NamedTuple.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)`.
@Blacksmoke16 Blacksmoke16 added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:collection labels Apr 18, 2022
HertzDevil added a commit to HertzDevil/crystal that referenced this pull request Apr 18, 2022
@beta-ziliani beta-ziliani modified the milestones: 1.5.0, 1.4.1 Apr 19, 2022
@beta-ziliani beta-ziliani merged commit e34020d into crystal-lang:master Apr 21, 2022
@I3oris I3oris deleted the bug/merge_two_empty_named_tuples branch April 23, 2022 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:stdlib:collection
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compile-time error when merging two empty NamedTuples
5 participants