Skip to content

Why does Fn.call arity allow more arguments? #1140

Answered by PureFox48
Deijin27 asked this question in Q&A
Discussion options

You must be logged in to vote

It should definitely be an error to call a function with too many arguments IMO. Possibly the reason why it's allowed for functions but not methods is because the former do not allow overloading based on arity but the latter, of course, do.

The current situation is in fact down-right dangerous - see #731 and #1050.

@mhermier has posted a PR (#1124) to fix the dangerous part. I'd like to see this go further and outlaw excess arguments altogether.

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Deijin27
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants