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

ArgumentError message differs on multiple unknown keywords args #4555

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

ArgumentError message differs on multiple unknown keywords args #4555

MSNexploder opened this issue Apr 2, 2017 · 2 comments
Labels
Milestone

Comments

@MSNexploder
Copy link
Contributor

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
Copy link
Member

headius commented Apr 19, 2017

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

@MSNexploder
Copy link
Contributor Author

exactly

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

No branches or pull requests

3 participants