Skip to content

Commit 20a4067

Browse files
committed
Remove unneeded type param from PrefixContext
1 parent 2fcb4d8 commit 20a4067

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/contexts.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,8 @@ end
265265
266266
Apply the prefixes in the context `ctx` to the variable name `vn`.
267267
"""
268-
function prefix(ctx::PrefixContext{Prefix}, vn::VarName{Sym}) where {Prefix,Sym}
269-
return AbstractPPL.prefix(prefix(childcontext(ctx), vn), VarName{Symbol(Prefix)}())
268+
function prefix(ctx::PrefixContext{Prefix}, vn::VarName) where {Prefix}
269+
return AbstractPPL.prefix(prefix(childcontext(ctx), vn), VarName{Prefix}())
270270
end
271271
function prefix(ctx::AbstractContext, vn::VarName)
272272
return prefix(NodeTrait(ctx), ctx, vn)

src/utils.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1286,7 +1286,9 @@ broadcast_safe(x::Distribution) = (x,)
12861286
broadcast_safe(x::AbstractContext) = (x,)
12871287

12881288
# Convert (x=1,) to Dict(@varname(x) => 1)
1289-
to_varname_dict(nt::NamedTuple) = Dict(VarName{k}() => v for (k, v) in pairs(nt))
1289+
function to_varname_dict(nt::NamedTuple)
1290+
return Dict{VarName,Any}(VarName{k}() => v for (k, v) in pairs(nt))
1291+
end
12901292
to_varname_dict(d::AbstractDict) = d
12911293
# Version of `merge` used by `conditioned` and `fixed` to handle
12921294
# the scenario where we might try to merge a dict with an empty

0 commit comments

Comments
 (0)