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

Fix incorrect use of coercion #5

Closed
wants to merge 1 commit into from
Closed

Conversation

vrurg
Copy link

@vrurg vrurg commented Jan 10, 2022

Previously incorrect behavior of coercions caused List(%h) to result in a list consisting of a single hash element. But the above construct is actually equivalent to %h.List. There're two approaches resulting in the desired out come:

  • List.new(%h)
  • (%h,)

For this fix I've chosen the latter as more elegant.

Previously incorrect behavior of coercions caused `List(%h)` to result
in a list consisting of a single hash element. But the above construct
is actually equivalent to `%h.List`. There're two approaches resulting
in the desired out come:

- `List.new(%h)`
- (%h,)

For this fix I've chosen the latter as more elegant.
@vrurg vrurg mentioned this pull request Jan 10, 2022
13 tasks
@atweiden atweiden closed this in 67c6f94 Jan 12, 2022
@atweiden
Copy link
Owner

Thanks for this. List.new makes the intent clearer than does a trailing comma — which is easy to overlook.

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.

None yet

2 participants