Skip to content

Commit

Permalink
* :binding :shadow can be nil
Browse files Browse the repository at this point in the history
* basic let tests
  • Loading branch information
swannodette committed Oct 25, 2024
1 parent 2a8db4d commit fd5b19f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 2 additions & 6 deletions src/test/clojure/cljs/analyzer/spec_tests.clj
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,11 @@

(deftest test-let
(is (s/valid? ::a/node (analyze ns-env '(let []))))
;(is (s/valid? ::a/node (analyze ns-env '(let [x 1]))))
;(is (s/valid? ::a/node (analyze ns-env '(let [x 1] x))))
)
(is (s/valid? ::a/node (analyze ns-env '(let [x 1]))))
(is (s/valid? ::a/node (analyze ns-env '(let [x 1] x)))))

(comment

(test/run-tests)

;; next, problem - some fields are nil
(s/explain ::a/node (analyze ns-env '(let [x 1])))

)
4 changes: 3 additions & 1 deletion src/test/clojure/cljs/analyzer/specs.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
#{:arg :catch :fn :let :letfn :loop :field})
(s/def ::variadic? boolean?)
(s/def ::init ::node)
(s/def ::shadow ::node)
(s/def ::shadow
(s/or :nil nil?
:node ::node))

(defmethod node :binding [_]
(s/merge
Expand Down

0 comments on commit fd5b19f

Please sign in to comment.