Skip to content

Commit

Permalink
Fix #928: record constructor supports optional meta + ext map
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Sep 30, 2024
1 parent f83e9cf commit a7642b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ SCI is used in [babashka](https://github.com/babashka/babashka),

- Fix [#926](https://github.com/babashka/sci/issues/926): Support `add-watch` on vars in CLJS
- Support `aset` on primitive array using reflection
- Fix [#928](https://github.com/babashka/sci/issues/928): record constructor supports optional meta + ext map

## 0.8.43 (2024-08-06)

Expand Down
5 changes: 4 additions & 1 deletion test/sci/records_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@
(tu/eval*
"(defprotocol IFoo (foo [this]))
(defrecord Foo [x] IFoo (foo [this] (Foo. x)))
(into {} (foo (Foo. 1)))" {})))))
(into {} (foo (Foo. 1)))" {}))))
(testing "meta and ext"
(is (true? (tu/eval* "(defrecord Dude [x]) (let [x (new Dude 1 {:meta 1} {:ext 2})]
(and (= 1 (:x x)) (= 1 (:meta (meta x))) (= 2 (:ext x))))" {})))))

(deftest repr-test
(let [prog "
Expand Down

0 comments on commit a7642b1

Please sign in to comment.