I think it would be reasonable to expect that collect(keys(vi)) would return a vector VarNames, but this is not always true for SimpleVarInfo. You can, in fact, make the key type be whatever you want:
julia> collect(keys(DynamicPPL.SimpleVarInfo(OrderedDict(0 => 1))))
1-element Vector{Int64}:
0
Maybe more commonly, empty SimpleVarInfos are trouble:
julia> collect(keys(DynamicPPL.SimpleVarInfo(OrderedDict())))
Any[]
julia> collect(keys(DynamicPPL.SimpleVarInfo()))
Union{}[]
See https://github.com/TuringLang/DynamicPPL.jl/pull/780/files#r1928908281
We could just fix keys, but I wonder, as @penelopeysm says in the above comment, whether we should put more strict bounds on the values field.
I think it would be reasonable to expect that
collect(keys(vi))would return a vectorVarNames, but this is not always true forSimpleVarInfo. You can, in fact, make the key type be whatever you want:Maybe more commonly, empty
SimpleVarInfos are trouble:See https://github.com/TuringLang/DynamicPPL.jl/pull/780/files#r1928908281
We could just fix
keys, but I wonder, as @penelopeysm says in the above comment, whether we should put more strict bounds on thevaluesfield.