Skip to content

Commit 8c7aff9

Browse files
committed
Force conditioned to return a dict
1 parent 88da7bd commit 8c7aff9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/contexts.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,14 +480,14 @@ a merged version of the condition values.
480480
function conditioned(context::AbstractContext)
481481
return conditioned(NodeTrait(conditioned, context), context)
482482
end
483-
conditioned(::IsLeaf, context) = NamedTuple()
483+
conditioned(::IsLeaf, context) = Dict{VarName,Any}()
484484
conditioned(::IsParent, context) = conditioned(childcontext(context))
485485
function conditioned(context::ConditionContext)
486486
# Note the order of arguments to `merge`. The behavior of the rest of DPPL
487487
# is that the outermost `context` takes precendence, hence when resolving
488488
# the `conditioned` variables we need to ensure that `context.values` takes
489489
# precedence over decendants of `context`.
490-
return _merge(context.values, conditioned(childcontext(context)))
490+
return _merge(to_varname_dict(context.values), conditioned(childcontext(context)))
491491
end
492492
function conditioned(context::PrefixContext)
493493
return conditioned(collapse_prefix_stack(context))

0 commit comments

Comments
 (0)