Skip to content

Commit f794acc

Browse files
committed
Improve error message
1 parent 4c69010 commit f794acc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/compiler.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,15 @@ function check_dot_tilde_rhs(@nospecialize(x))
203203
ArgumentError("the right-hand side of a `.~` must be a `UnivariateDistribution`")
204204
)
205205
end
206+
function check_dot_tilde_rhs(x::AbstactArray{<:Distribution})
207+
msg = """
208+
As of v0.35, DynamicPPL does not allow arrays of distributions in `.~`. \
209+
Please use `product_distribution` instead, or write a loop if necessary. \
210+
See https://github.com/TuringLang/DynamicPPL.jl/releases/tag/v0.35.0 for more \
211+
details.\
212+
"""
213+
return throw(ArgumentError(msg))
214+
end
206215
check_dot_tilde_rhs(x::UnivariateDistribution) = x
207216
function check_dot_tilde_rhs(x::Sampleable{<:Any,AutoPrefix}) where {AutoPrefix}
208217
model = check_dot_tilde_rhs(x.model)

0 commit comments

Comments
 (0)