Skip to content

Commit

Permalink
SCI: records should have keys set to nil
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Jan 13, 2025
1 parent 6892bc6 commit 920b6b3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/sci/impl/records.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@
impls)))
protocol-impls
raw-protocol-impls)
arg-syms (mapv #(symbol (name %)) keys)]
arg-syms (mapv #(symbol (name %)) keys)
nil-map (zipmap (map keyword field-set) (repeat nil))]
`(do
(declare ~record-name ~factory-fn-sym ~constructor-fn-sym ~map-factory-sym)
(def ~(with-meta record-name
Expand All @@ -337,7 +338,7 @@
([~@arg-syms]
(~constructor-fn-sym ~@arg-syms nil nil)))
(defn ~map-factory-sym [m#]
(sci.impl.records/->record-impl '~rec-type ~rec-type (var ~record-name) m#))
(sci.impl.records/->record-impl '~rec-type ~rec-type (var ~record-name) (merge '~nil-map m#)))
~@protocol-impls
~record-name))))

Expand Down

0 comments on commit 920b6b3

Please sign in to comment.