Improve error message when calling a keyword with the wrong number of arguments

Description

Problem

When you call a Keyword with the wrong number of arguments, the error message does not report how many arguments were passed

Context

compare to calling an IFn, which does show the number of arguments passed:

The latter error message is more clear and makes it easier to debug.

The attached patch re-uses the ArityException class used elsewhere to generate error messages in the latter form when calling a keyword with the wrong number of arguments.

Addresses CLJ-1067

Patch: clj-2350-4.patch (improves commit message over last, patch same, attribution retained)

Screened by: Alex Miller

Environment

None

Attachments

5

Activity

Show:

Alex Miller September 14, 2021 at 2:49 PM

Applied for 1.11.0-alpha2

Marc O'Morain September 17, 2018 at 5:22 PM

Thanks Alex

Alex Miller September 17, 2018 at 2:32 PM

I've screened, but I'm not sure we'll look at it for 1.10. I will rebase if needed, no big deal.

Marc O'Morain September 17, 2018 at 10:13 AM

Hi Alex,

Any update on this ticket? I’m anxious to avoid having to rebase the patch against master again.

Marc

Alex Miller July 20, 2018 at 11:08 PM

I’ll get to it next time I cycle through.

Fixed

Details

Assignee

Reporter

Labels

Approval

Ok

Patch

Code and Test

Priority

Affects versions

Fix versions

Created May 3, 2018 at 1:46 PM
Updated September 14, 2021 at 2:49 PM
Resolved September 14, 2021 at 2:49 PM