-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gen.choicemap
constructor assigns choice-map args as leaves
#517
Comments
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? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In this version of the constructor: https://github.com/probcomp/Gen.jl/blob/master/src/choice_map.jl#L651-L661
This line:
choices[addr] = value
assigns the value as a leaf always, leading to this erro:
The text was updated successfully, but these errors were encountered: