oracle / truffleruby

A high performance implementation of the Ruby programming language, built on GraalVM.
https://www.graalvm.org/ruby/
Other
3.02k stars 185 forks source link

ArgumentError message differs on multiple unknown keywords args #1522

Closed deepj closed 2 years ago

deepj commented 5 years ago

This is the same problem like in JRuby https://github.com/jruby/jruby/issues/4555

MRI returns all unknown kwargs while calling a method. Instead of TruffleRuby returns only first one.

To reproduce:

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

MRI (2.5.3):

Traceback (most recent call last):
        3: from ~/.rubies/ruby-2.5.3/bin/irb:11:in `<main>'
        2: from (irb):3
        1: from (irb):2:in `foo'
ArgumentError (unknown keywords: blah, blah2)

TruffleRuby (1.0.0.-rc10):

ArgumentError: unknown keyword: blah
    from (irb):2:in `foo'
    from (irb):3
    from ~/.rubies/truffleruby-1.0.0-rc10/bin/irb:29:in `<main>'

The problem is, TruffleRuby shows only the first invalid kwarg.

eregon commented 5 years ago

GraphQL specs seem to depend on this: https://github.com/rmosolgo/graphql-ruby/pull/726

deepj commented 2 years ago

Still a problem in truffleruby 22.2.0-dev-84832be1, like ruby 3.0.3, GraalVM CE Native [aarch64-darwin]

andrykonchin commented 2 years ago

Fixed in 66bd905965f72601c7d40f845b380812a04eb91d. Thank you for reporting the issue.