You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When destructuring is used in an if-let, a binding defined outside of the if-let is considered unused even when it is used in the else branch if the destructuring in the if-let binds the same symbol.
repro
(nsfoo)
(defnbar [a] ;; <-- warning: unused binding a
(if-let [{:keys [a]} nil]
a
a))
Linting reports:
/tmp/foo.clj:3:13: warning: unused binding a
expected behavior
I would expect the binding to not be reported as unused, since it is actually used in the else branch.
The text was updated successfully, but these errors were encountered:
version
clj-kondo v2020.01.27
platform
Native on MacOS.
editor
N/A
problem
When destructuring is used in an
if-let
, a binding defined outside of theif-let
is considered unused even when it is used in the else branch if the destructuring in theif-let
binds the same symbol.repro
Linting reports:
/tmp/foo.clj:3:13: warning: unused binding a
expected behavior
I would expect the binding to not be reported as unused, since it is actually used in the else branch.
The text was updated successfully, but these errors were encountered: