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

ArgumentError message differs on multiple unknown keywords args #4555

Closed
MSNexploder opened this Issue Apr 2, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@MSNexploder
Contributor

MSNexploder commented Apr 2, 2017

Calling a method with multiple unknown keywords arguments in CRuby results in an Argument Error listing all unknown keywords.
In JRuby only the first unknown keyword is present in the error message.

Example

def foo(bar: 'baz'); end
foo(blah: nil, blah2: nil)

Expected Behavior

ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin16]

test.rb:1:in `foo': unknown keywords: blah, blah2 (ArgumentError)
	from test.rb:2:in `<main>'

Actual Behavior

jruby 9.1.9.0-SNAPSHOT (2.3.3) 2017-03-21 e7bcde5 Java HotSpot(TM) 64-Bit Server VM 25.121-b13 on 1.8.0_121-b13 [darwin-x86_64]

ArgumentError: unknown keyword: blah
     foo at test.rb:2
  <main> at test.rb:2

jruby 9.1.8.0 (2.3.1) 2017-03-06 90fc7ab Java HotSpot(TM) 64-Bit Server VM 25.121-b13 on 1.8.0_121-b13 [darwin-x86_64]

ArgumentError: unknown keyword: blah
     foo at test.rb:2
  <main> at test.rb:2

@enebo enebo added the ir label Apr 3, 2017

@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius Apr 19, 2017

Member

So the main issue is that it only shows the first invalid kwarg, yes?

Member

headius commented Apr 19, 2017

So the main issue is that it only shows the first invalid kwarg, yes?

@MSNexploder

This comment has been minimized.

Show comment
Hide comment
@MSNexploder

MSNexploder Apr 19, 2017

Contributor

exactly

Contributor

MSNexploder commented Apr 19, 2017

exactly

@headius headius closed this in 29487eb Apr 19, 2017

@enebo enebo added this to the JRuby 9.1.9.0 milestone May 11, 2017

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