Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[2.0] Incorrect arity checking for methods with kw arguments #1049

Closed
97jaz opened this Issue · 0 comments

1 participant

97jaz
97jaz

The following program should raise an ArgumentError:

def test(foo: 10)
  foo
end

test(3)

In the latest JRuby it instead produces 10.

On the other hand, this should not raise an argument error:

def test(foo, bar: 10)
  [foo, bar]
end

test(no: "way")

...but it does. (MRI 2.0.0p0 also got this wrong, but p247 displays correct behavior.)

97jaz 97jaz referenced this issue from a commit in 97jaz/jruby
97jaz 97jaz Fixes #1049: incorrect arity checking for kw arguments
There were two basic problems with the existing logic:
* Arguments could be treated both as kw args and as, e.g.,
optional args.
* An arity check for methods with kw arguments in the Arity class
is deferred to asignment time, but the check was not being performed
there, either.
9a214cb
97jaz 97jaz referenced this issue from a commit in 97jaz/jruby
97jaz 97jaz Fixes #1049: incorrect arity checking for kw arguments
There were two basic problems with the existing logic:
* Arguments could be treated both as kw args and as, e.g.,
optional args.
* An arity check for methods with kw arguments in the Arity class
is deferred to asignment time, but the check was not being performed
there, either.
5c5bf13
Charles Oliver Nutter headius closed this issue from a commit
97jaz 97jaz Fixes #1049: incorrect arity checking for kw arguments
There were two basic problems with the existing logic:
* Arguments could be treated both as kw args and as, e.g.,
optional args.
* An arity check for methods with kw arguments in the Arity class
is deferred to asignment time, but the check was not being performed
there, either.
86a3ecf
Charles Oliver Nutter headius closed this in 86a3ecf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.