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

Consider adding linter to warn about duplicate names in function/macro parameter lists #241

Closed
jafingerhut opened this issue Dec 15, 2017 · 3 comments

Comments

@jafingerhut
Copy link
Collaborator

jafingerhut commented Dec 15, 2017

It should not warn about duplicate names that begin with '_', since those by convention are for ignored parameters, but something like this should warn:

(defn foo [a a a]
  (+ a a))

I don't know yet how tricky this might get with destructuring in arg lists.

Suggested here (and perhaps in other CLJ tickets as well, not sure): https://dev.clojure.org/jira/browse/CLJ-2293

@jafingerhut
Copy link
Collaborator Author

jafingerhut commented Dec 15, 2017

Not exactly a duplicate of this issue, but related: #225

Catching the example in the previous comment is a simpler thing to do.

Catching duplicated names anywhere in any sequential or associative destructuring in a defn, defn-, or fn arg vector would be more useful to Eastwood users than a check that only caught such duplicate names in the absence of destructuring.

@slipset
Copy link
Collaborator

slipset commented May 13, 2018

This seems to be caught by redefd-vars in 2.7.0-SNAPSHOT

@vemv
Copy link
Collaborator

vemv commented Jan 9, 2022

This seems to be caught by redefd-vars in 2.7.0-SNAPSHOT

Indeed:

duplicate-params: Local name `a` occurs multiple times in the same argument vector.

@vemv vemv closed this as completed Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants