Skip to content

Commit

Permalink
Fix #1807: false positive with map transducer in cljs
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Sep 14, 2022
1 parent 32dd668 commit b31a98d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/clj_kondo/impl/analyzer.clj
Expand Up @@ -1675,7 +1675,8 @@
keep keep-indexed])
arg-count (if (and transducer-eligable?
(zero? arg-count)) ;; transducer
(if (and (= 'clojure.core hof-ns-name)
(if (and (or (= 'clojure.core hof-ns-name)
(= 'cljs.core hof-ns-name))
(or (= 'map hof-resolved-name)
(= 'mapcat hof-resolved-name)))
nil 1)
Expand Down
1 change: 1 addition & 0 deletions test/clj_kondo/invalid_arity_test.clj
Expand Up @@ -149,6 +149,7 @@
(is (empty? (lint! "(reduce (fn [acc e]) [1 2 3])")))
(is (empty? (lint! "(sequence (map (fn [_ _])) (range 10) (range 10))")))
(is (empty? (lint! "(sequence (mapcat (fn [_ _])) (range 10) (range 10))")))
(is (empty? (lint! "(map (fn [_results _cols]))" "--lang" "cljs")))
(assert-submaps
'({:file "<stdin>", :row 1, :col 6, :level :error,
:message "clojure.core/inc is called with 2 args but expects 1"})
Expand Down

0 comments on commit b31a98d

Please sign in to comment.