Skip to content

Commit 7341697

Browse files
author
dnolen
committed
CLJS-924: Better error message for mistaken use of 'def'
1 parent 039d4f2 commit 7341697

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/clojure/cljs/analyzer.cljc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,6 +1291,8 @@
12911291

12921292
(defmethod parse 'def
12931293
[op env form _ _]
1294+
(when (> (count form) 4)
1295+
(throw (error env "Too many arguments to def")))
12941296
(let [pfn (fn
12951297
([_ sym] {:sym sym})
12961298
([_ sym init] {:sym sym :init init})

0 commit comments

Comments
 (0)