From fd5b19f0b6e1849c965fdd62515a7aa1cbb7345c Mon Sep 17 00:00:00 2001 From: davidnolen Date: Fri, 25 Oct 2024 08:58:10 -0400 Subject: [PATCH] * :binding :shadow can be nil * basic let tests --- src/test/clojure/cljs/analyzer/spec_tests.clj | 8 ++------ src/test/clojure/cljs/analyzer/specs.cljc | 4 +++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/test/clojure/cljs/analyzer/spec_tests.clj b/src/test/clojure/cljs/analyzer/spec_tests.clj index 55ad63637..2653299d3 100644 --- a/src/test/clojure/cljs/analyzer/spec_tests.clj +++ b/src/test/clojure/cljs/analyzer/spec_tests.clj @@ -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]))) - ) diff --git a/src/test/clojure/cljs/analyzer/specs.cljc b/src/test/clojure/cljs/analyzer/specs.cljc index a99818c3f..74abd328a 100644 --- a/src/test/clojure/cljs/analyzer/specs.cljc +++ b/src/test/clojure/cljs/analyzer/specs.cljc @@ -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