Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by

Currently a definition like

(defn set! (link: ) ...)

will not cause any warning. Any usage of it (without {{:as}} namespace aliasing) however will not use the defined var but the set! special form.

A warning seems appropriate.

5 Answers

0 votes
by

Comment made by: anmonteiro

Attached patch with fix and test.

0 votes
by
_Comment made by: mfikes_

I know David suggested that a hard error is probably the right thing to do for this one, but one consequence is that the {{cljs.spec/def}} macro cannot be defined in bootstrap with this change. (I haven't investigated thoroughly, but this may simply be the result of macros being processed as ClojureScript in bootstrap, and thus being subject to this new guard.)

Regardless of the root cause, you'll see this if you try to run {{script/test-self-parity}}:


#error {:message "Could not eval cljs.spec", :data {:tag :cljs/analysis-error}, :cause #error {:message "Can't def special form at line 51 ", :data {:file nil, :line 51, :column 1, :tag :cljs/analysis-error}}}
 

For reference: Line 51 currently points at the {{def}} macro: https://github.com/clojure/clojurescript/blob/e2db5d9ff8cb6a099ebc2a8cd379385bf4649b38/src/main/cljs/cljs/spec.cljc#L51
0 votes
by

Comment made by: mfikes

Patch no longer applies.

0 votes
by

Comment made by: ray.mcdermott

This is assigned to (link: ~anmonteiro) but it seems like nothing has happened for a while.

Is it OK if I take it over?

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJS-1474 (reported by martinklepsch)
...