Skip to content

Commit ec80266

Browse files
Stuart Sierrastuarthalloway
Stuart Sierra
authored andcommitted
CLJ-940: check for sequential collection after :only/:refer
Throws more informative error in the following cases: (ns (:require [foo :refer bar])) (ns (:use [foo :only bar])) (refer 'foo :only 'bar) Signed-off-by: Stuart Halloway <[email protected]>
1 parent 4ca0f7e commit ec80266

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/clj/clojure/core.clj

+2
Original file line numberDiff line numberDiff line change
@@ -3800,6 +3800,8 @@
38003800
to-do (if (= :all (:refer fs))
38013801
(keys nspublics)
38023802
(or (:refer fs) (:only fs) (keys nspublics)))]
3803+
(when-not (instance? clojure.lang.Sequential to-do)
3804+
(throw (new Exception ":only/:refer value must be a sequential collection of symbols")))
38033805
(doseq [sym to-do]
38043806
(when-not (exclude sym)
38053807
(let [v (nspublics sym)]

0 commit comments

Comments
 (0)