Skip to content

Commit 05cd4d5

Browse files
roman01lamfikes
authored andcommitted
CLJS-3086: Switch clj-nil to not be considered a numeric type
1 parent f7436cd commit 05cd4d5

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/main/clojure/cljs/analyzer.cljc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3477,7 +3477,6 @@
34773477
;; warning without this - David
34783478
(cond
34793479
(nil? t) true
3480-
(= 'clj-nil t) true
34813480
(js-tag? t) true ;; TODO: revisit
34823481
:else
34833482
(if (and (symbol? t) (some? (get NUMERIC_SET t)))

src/test/clojure/cljs/analyzer_tests.clj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,6 +1346,16 @@
13461346
(env/with-compiler-env test-cenv
13471347
(:tag (analyze test-env '(demunge-str "")))))))
13481348

1349+
(deftest test-cljs-3086
1350+
(let [ws (atom [])]
1351+
(try
1352+
(ana/with-warning-handlers [(collecting-warning-handler ws)]
1353+
(cljs.env/with-compiler-env test-cenv
1354+
(analyze (ana/empty-env)
1355+
'(+ nil 1))))
1356+
(catch Exception _))
1357+
(is (= ["cljs.core/+, all arguments must be numbers, got [clj-nil number] instead"] @ws))))
1358+
13491359
(deftest test-cljs-3120
13501360
(let [cenv (core-env)
13511361
_ (analyze-forms cenv

0 commit comments

Comments
 (0)