Skip to content

Commit e66e6ae

Browse files
Apply suggestions from code review
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 0b7ba4b commit e66e6ae

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/context_implementations.jl

+3-2
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,9 @@ function dot_tilde_assume(context::PrefixContext, right, left, vn, vi)
304304
return dot_tilde_assume(context.context, right, left, prefix.(Ref(context), vn), vi)
305305
end
306306

307-
function dot_tilde_assume(rng::Random.AbstractRNG, context::PrefixContext, sampler, right, left, vn, vi)
307+
function dot_tilde_assume(
308+
rng::Random.AbstractRNG, context::PrefixContext, sampler, right, left, vn, vi
309+
)
308310
return dot_tilde_assume(
309311
rng, context.context, sampler, right, left, prefix.(Ref(context), vn), vi
310312
)
@@ -346,7 +348,6 @@ end
346348
function dot_tilde_assume(
347349
rng::Random.AbstractRNG, context::FixedContext, sampler, right, left, vns, vi
348350
)
349-
350351
if !has_fixed_symbol(context, first(vns))
351352
# Defer to `childcontext`.
352353
return tilde_assume(rng, childcontext(context), sampler, right, left, vns, vi)

src/contexts.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ setchildcontext(parent::FixedContext, child) = FixedContext(parent.values, child
504504
has_fixed_symbol(context::FixedContext, vn::VarName) = has_symbol(context.values, vn)
505505

506506
has_symbol(d::AbstractDict, vn::VarName) = haskey(d, vn)
507-
@generated function has_symbol(::NamedTuple{names}, ::VarName{sym}) where {names, sym}
507+
@generated function has_symbol(::NamedTuple{names}, ::VarName{sym}) where {names,sym}
508508
return sym in names
509509
end
510510

test/compiler.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ module Issue537 end
733733
@testset "invalid .~ expressions" begin
734734
@model function demo_with_invalid_dot_tilde()
735735
m = Matrix{Float64}(undef, 1, 2)
736-
m .~ [Normal(); Normal()]
736+
return m .~ [Normal(); Normal()]
737737
end
738738

739739
@test_throws ArgumentError demo_with_invalid_dot_tilde()()

0 commit comments

Comments
 (0)