Skip to content

Gen.choicemap constructor assigns choice-map args as leaves #517

@sritchie

Description

@sritchie

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:

julia> cm = Gen.choicemap(:k => Gen.choicemap(:v => 2))
│
└── :k : DynamicChoiceMap(Dict{Any, Any}(:v => 2), Dict{Any, Any}())


julia> Gen.has_value(cm, :k)
true

julia> Gen.has_submap(cm, :k)
false

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions