Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
* `import` now returns nil instead of the last module's string representation (#1174)

### Fixed
* Fix a bug in `defn` where the `attr-map?` and function metdata were merged into a seq instead of a map, causing `macroexpand` to fail in some cases (#1186)

## [v0.3.5]
### Changed
* `alter-var-root` now returns the new value to align with Clojure behavior. Updated the docstring to highlight side effects of direct linking optimization (#1166)
Expand Down
2 changes: 1 addition & 1 deletion src/basilisp/core.lpy
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@
(first body)
nil)
fname (if fmeta
(vary-meta name conj fmeta)
(vary-meta name #(conj {} %1 %2) fmeta)
name)
fname (if doc
(vary-meta fname assoc :doc doc)
Expand Down
19 changes: 18 additions & 1 deletion tests/basilisp/test_core_macros.lpy
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,24 @@
(is (= 'f8 (:name vmeta)))
(is (= '([] [a]) (:arglists vmeta)))
(is (= "0.1" (:added vmeta)))
(is (= "another multi-arity docstring" (:doc vmeta)))))))
(is (= "another multi-arity docstring" (:doc vmeta))))))

(testing "meta"
(let [fvar (defn ^{:abc 9} f9 [] :kw)
vmeta (meta fvar)]
(is (= 'f9 (:name vmeta)))
(is (= '([]) (:arglists vmeta)))
(is (= 9 (:abc vmeta)))))

(testing "attr-map? and meta"
(let [fvar (defn ^{:abc 9 :lmn 15} f10 {:abc 10 :xyz 11} [] :kw)
vmeta (meta fvar)]
(is (= 'f10 (:name vmeta)))
(is (= '([]) (:arglists vmeta)))
(is (= {:abc 10 :lmn 15 :xyz 11} (select-keys vmeta [:abc :lmn :xyz])))))

(testing "macroexpand with attr-map?"
(is (macroexpand '(defn fx {:abc 10} [] :kw)))))

(deftest defasync-test
(testing "single arity defasync"
Expand Down
Loading