Skip to content

Commit b75bb5f

Browse files
committed
Fix undefined method
1 parent 07c0cee commit b75bb5f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/context_implementations.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ using Distributions: UnivariateDistribution,
33
MatrixDistribution,
44
Distribution
55

6+
const AMBIGUITY_MSG = "Ambiguous `LHS .~ RHS` or `@. LHS ~ RHS` syntax. The broadcasting " *
7+
"can either be column-wise following the convention of Distributions.jl or " *
8+
"element-wise following Julia's general broadcasting semantics. Please make sure " *
9+
"that the element type of `LHS` is not a supertype of the support type of " *
10+
"`AbstractVector` to eliminate ambiguity."
611

712
alg_str(spl::Sampler) = string(nameof(typeof(spl.alg)))
813

@@ -239,7 +244,7 @@ function _dot_tilde(
239244
vn::AbstractVector{<:VarName},
240245
vi,
241246
)
242-
throw(ambiguity_error_msg())
247+
throw(DimensionMismatch(AMBIGUITY_MSG))
243248
end
244249

245250
function dot_assume(
@@ -420,7 +425,7 @@ function _dot_tilde(
420425
left::AbstractMatrix{>:AbstractVector},
421426
vi,
422427
)
423-
throw(ambiguity_error_msg())
428+
throw(DimensionMismatch(AMBIGUITY_MSG))
424429
end
425430

426431
function dot_observe(

0 commit comments

Comments
 (0)