Skip to content

Commit

Permalink
Merge pull request #364 from stan-dev/rvar-type-check
Browse files Browse the repository at this point in the history
type check assertions for rvar draws, closes #363
  • Loading branch information
mjskay authored May 7, 2024
2 parents 609028d + 15dc777 commit fd72161
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions R/rvar-.R
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,13 @@ drop_chain_dim <- function(x) {
#' (first one is draws), etc.
#' @noRd
cleanup_rvar_draws <- function(x) {
assert(
check_numeric(x),
check_logical(x),
check_factor(x),
check_character(x)
)

if (length(x) == 0) {
# canonical NULL rvar is at least 1 draw of nothing
# this ensures that (e.g.) extending a null rvar
Expand Down

0 comments on commit fd72161

Please sign in to comment.