Skip to content

Commit 6ed9492

Browse files
committed
CLJS-3190: Double arity warning constructing directly-accessed record
1 parent 910fbe3 commit 6ed9492

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Diff for: src/main/clojure/cljs/analyzer.cljc

+1-1
Original file line numberDiff line numberDiff line change
@@ -3681,7 +3681,7 @@
36813681
(== 1 (count args))
36823682
(record-with-field? (:tag (first argexprs)) (symbol (name f))))
36833683
(let [field-access-form (list* (symbol (str ".-" (name f))) args)]
3684-
(analyze env field-access-form))
3684+
(no-warn (analyze env field-access-form)))
36853685
{:env env :op :invoke :form form :fn fexpr :args argexprs
36863686
:children [:fn :args]})))))
36873687

Diff for: src/test/clojure/cljs/analyzer_tests.clj

+11
Original file line numberDiff line numberDiff line change
@@ -2110,3 +2110,14 @@
21102110
a
21112111
(recur b 1)))))))
21122112
'any)))
2113+
2114+
(deftest test-cljs-3190
2115+
(let [ws (atom [])]
2116+
(ana/with-warning-handlers [(collecting-warning-handler ws)]
2117+
(env/with-compiler-env @test-cenv
2118+
(analyze (ana/empty-env)
2119+
'(do
2120+
(defrecord Foo [a])
2121+
(:a (->Foo))))))
2122+
(is (= 1 (count @ws)))
2123+
(is (string/starts-with? (first @ws) "Wrong number of args (0) passed to cljs.user/->Foo"))))

0 commit comments

Comments
 (0)