File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
test/clojure/test_clojure Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -2022,7 +2022,9 @@ else if(v == Boolean.FALSE)
20222022 return NumberExpr .parse ((Number )v );
20232023 else if (v instanceof String )
20242024 return new StringExpr ((String ) v );
2025- else if (v instanceof IPersistentCollection && ((IPersistentCollection ) v ).count () == 0 )
2025+ else if (v instanceof IPersistentCollection
2026+ && (((IPersistentCollection ) v ).count () == 0 )
2027+ && (!(v instanceof IObj ) || ((IObj ) v ).meta () == null ))
20262028 return new EmptyExpr (v );
20272029 else
20282030 return new ConstantExpr (v );
Original file line number Diff line number Diff line change 5151 (def ^{:a 1 } foo 0 )
5252 #'foo)]
5353 (is (= 1 (-> v meta :a )))))
54+ (testing " const vars preserve metadata"
55+ (let [[v1 v2] (eval-in-temp-ns
56+ (def ^:const foo ^:foo [])
57+ (def ^:const bar ^:foo [:bar ])
58+ [(meta foo) (meta bar)])]
59+ (is (= {:foo true } v1))
60+ (is (= {:foo true } v2))))
5461 #_ (testing " subsequent declare doesn't overwrite metadata"
5562 (let [v (eval-in-temp-ns
5663 (def ^{:b 2 } bar 0 )
You can’t perform that action at this time.
0 commit comments