Skip to content

Commit

Permalink
[#981] Aliased keyword not detected in quoted forms
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Sep 1, 2020
1 parent bb12c68 commit 09701bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/clj_kondo/impl/analyzer.clj
Expand Up @@ -1616,7 +1616,12 @@
children))
:fn (recur (assoc ctx :arg-types nil)
(macroexpand/expand-fn expr))
:token (when-not (or (:quoted ctx) (= :edn (:lang ctx))) (analyze-usages2 ctx expr))
:token
(if (:quoted ctx)
(when (:k expr)
(usages/analyze-keyword ctx expr))
(when-not (= :edn (:lang ctx))
(analyze-usages2 ctx expr)))
:list
(if-let [function (some->>
(first children)
Expand Down
3 changes: 2 additions & 1 deletion test/clj_kondo/main_test.clj
Expand Up @@ -1759,7 +1759,8 @@ foo/foo ;; this does use the private var
(is (empty? (lint! "(def x) (doto x)")))
(is (empty? (lint! "(def ^:private a 1) (let [{:keys [a] :or {a a}} {}] a)"
{:linters {:unused-binding {:level :warning}}})))
(is (empty? (lint! "(scala.Int/MinValue)" {:linters {:unresolved-symbol {:level :error}}}))))
(is (empty? (lint! "(scala.Int/MinValue)" {:linters {:unresolved-symbol {:level :error}}})))
(is (empty? (lint! "(require '[clojure.string :as s]) '::s/foo"))))

(deftest proxy-super-test
(is (empty? (lint! "
Expand Down

0 comments on commit 09701bf

Please sign in to comment.