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

no argument checking is done on a lambda with no parameters #4175

Closed
robfors opened this issue Dec 3, 2018 · 0 comments
Closed

no argument checking is done on a lambda with no parameters #4175

robfors opened this issue Dec 3, 2018 · 0 comments

Comments

@robfors
Copy link
Contributor

@robfors robfors commented Dec 3, 2018

CRuby:

(lambda {}).call(1) #=> ArgumentError: wrong number of arguments (given 1, expected 0)
(lambda {||}).call(1) #=> ArgumentError: wrong number of arguments (given 1, expected 0)

mruby:

(lambda {}).call(1) #=> nil
(lambda {||}).call(1) #=> nil

Tested on 26475d0.

@matz matz closed this in bdc9de8 Feb 7, 2019
ksekimoto added a commit to ksekimoto/mruby that referenced this issue Jul 16, 2021
So that `lambda{}.call(1)` raises `ArgumentError` as CRuby does.
Also, fixed junk assignment for `lambda{|;a|p a}.call{}`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant