weavejester/integrant

Refs/Refsets not preserved after expansion

james-doolan opened this issue · 1 comments

expand replaces Refs/Refsets with maps, resulting in an un-initialisable config.

(ns test
  (:require [integrant.core :as ig]))

(defmethod ig/init-key ::A [_ c] c)
(defmethod ig/init-key ::B [_ c] c)

(def config  {::A {:b1 (ig/ref ::B)
                   :b2 (ig/refset ::B)}
              ::B {}})

;; Expect the following to produce equivalent results:

(-> config ig/expand ig/init)
=> #:test{:A {:b1 {:key :test/B}, :b2 {:key :test/B}}, :B {}}

(-> config ig/init)
=> #:test{:B {}, :A {:b1 {}, :b2 #{{}}}}

Thanks for the report, and thanks for testing out the alpha to find this. I'll push a fix hopefully later today.