Welcome! Please see the About page for a little more info on how this works.

+1 vote
in Errors by
retagged by

If I call a method with the wrong number of arguments, I get a concise, descriptive error message:
(^[] String/toUpperCase "foo" 2) Syntax error... Invocation of method toUpperCase in class java.lang.String expected 0 arguments, but received 1

If I call a constructor with the wrong number of arguments, I get a very similar message:
(^[String] String/new "foo" 2) Syntax error... Invocation of method java.lang.String in class java.lang.String expected 1 arguments, but received 2

This message refers to the class name as the method, which feels like what you might get for a constructor.

I noticed that if my param-tags are incorrect on a constructor, the wording of the message is slightly different ("Expected to find 1 matching signature for constructor" as opposed to "for method"), so I just want to pose the question while these messages are somewhat fresh: Should the wording for the arity message mention 'constructor' or 'String/new' or something along those lines?

1 Answer

+1 vote
selected by
Best answer

Yes, seems like that is missing the constructor specific wording, will take a look, thanks.

Yeah, this is just a simple bug, we'll get it fixed in future alpha. Logged as https://clojure.atlassian.net/browse/CLJ-2835