Open sritchie opened 11 months ago
This behavior is the desired one, per the documentation of Gen.set_value! and Gen.set_submap!.
For the example above, the API requires breaking down the construction into separate calls:
julia> cm = Gen.choicemap()
julia> Gen.set_submap!(cm, :k, Gen.choicemap(:v =>2))
I would recommend that the constructor check and guard against this case though, yeah?
In this version of the constructor: https://github.com/probcomp/Gen.jl/blob/master/src/choice_map.jl#L651-L661
This line:
assigns the value as a leaf always, leading to this erro: