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

Renaming a namespace alias breaks destructured locals #2982

Open
N-litened opened this issue Nov 13, 2024 · 0 comments
Open

Renaming a namespace alias breaks destructured locals #2982

N-litened opened this issue Nov 13, 2024 · 0 comments

Comments

@N-litened
Copy link

If I have this code

(ns abcd
  (:require [abcd :as a]))

(defn get-id [{:keys [::a/id]}]
  (str id))

And Refactor→Rename alias a to aa, it will produce the following code:

(ns abcd
  (:require [abcd :as aa]))

(defn get-id [{:keys [::aa/id]}]
  (str ::aa/id))

This renaming replaces destructured local variables with keywords, thus breaking the code very subtly — there are no compilation errors, and in many cases no linting warnings.

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

No branches or pull requests

1 participant