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

Enhancement: warn about repeated/shadowed names in function arg destructuring #225

Open
jafingerhut opened this issue Jul 26, 2017 · 1 comment
Projects

Comments

@jafingerhut
Copy link
Collaborator

Example that would be nice to get a warning for, from @thheller on clojure-dev Slack channel:

(defn x [{:keys [foo]} foo]
  foo)
=> #'user/x
(x {} 1)
=> nil

The confusion is from foo being shadowed from a previous arg. Can be difficult to debug and understand what is going on.

@jafingerhut
Copy link
Collaborator Author

jafingerhut commented Oct 12, 2017

See this Clojure ticket for some potential related issues with map destructuring, although if Clojure 1.9 catches some of them as errors via clojure.spec, there is not much reason to repeat such checks in Eastwood.

https://dev.clojure.org/jira/browse/CLJ-1189

EDIT: It appears that the subtle mistakes mentioned in ticket CLJ-1189 are now caught as errors by Cloure 1.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Issues
Medium prio
Development

No branches or pull requests

1 participant