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

[Truffle] Argument Error #4243

Closed
bjfish opened this issue Oct 22, 2016 · 1 comment
Closed

[Truffle] Argument Error #4243

bjfish opened this issue Oct 22, 2016 · 1 comment
Milestone

Comments

@bjfish
Copy link
Contributor

bjfish commented Oct 22, 2016

Example

class Test
  def test_method a, b = 2, c = nil
    puts "Hello `#{a}`, `#{b}`, `#{c}`"
  end
end
args = ["a", 1, nil, nil]
Test.new.test_method(*args, &args.pop)

Expected Behavior

Hello `a`, `1`, ``

Actual Behavior

.rb:2:in `test_method': wrong number of arguments (4 for 1..3) (ArgumentError)

Found in rubygems/test_utilities.rb:263

@bjfish bjfish added the truffle label Oct 22, 2016
@eregon
Copy link
Member

eregon commented Oct 23, 2016

Looks very similar to https://bugs.ruby-lang.org/issues/12860, cc @headius
So I suppose the splat in the call should not duplicate the array then?

@bjfish bjfish closed this as completed Jan 14, 2017
@enebo enebo modified the milestone: truffle-dev Feb 10, 2017
@enebo enebo added this to the Non-Release milestone Dec 7, 2017
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

No branches or pull requests

3 participants