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

Hash.to_h with block not yielding splat args well #3607

Closed
HoneyryderChuck opened this issue Jun 26, 2024 · 2 comments
Closed

Hash.to_h with block not yielding splat args well #3607

HoneyryderChuck opened this issue Jun 26, 2024 · 2 comments

Comments

@HoneyryderChuck
Copy link
Contributor

Tested with latest (24.0.1):

value = {"a"=>1, "b"=>2}
value.to_h { |*args| puts args.inspect; args }

#=> ruby 3.3
# ["a", 1]
# ["b", 2]
# {"a"=>1, "b"=>2}

#=> truffleruby 24.0.1
[["a", 1]]
<internal:core> core/enumerable.rb:327:in `block in to_h': element has wrong array length (expected 2, was 1) (ArgumentError)
        from <internal:core> core/enumerable.rb:389:in `block in each_with_index'
        from <internal:core> core/enumerable.rb:387:in `each'
        from <internal:core> core/enumerable.rb:387:in `each_with_index'
@andrykonchin
Copy link
Member

Thank you for the report, we'll look into it.

@andrykonchin
Copy link
Member

Fixed in b0b947e.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants