DavisVaughan · GitHub

library(dplyr)
# check_type
case_when(TRUE ~ 1, TRUE ~ "x")
#> Error in names(message) <- `*vtmp*`: 'names' attribute [1] must be the same length as the vector [0]
# check_class
case_when(TRUE ~ 1, TRUE ~ structure(1, class = "foo"))
#> Error in names(message) <- `*vtmp*`: 'names' attribute [1] must be the same length as the vector [0]

These are supposed to report on invalid types and classes, respectively.

This happens because we are missing an argument here in replace_with(). That NULL is probably intended to be passed on to reason, but it is instead being matched to name and that doesn't work. A character name is required for that error path to run correctly.

out <- replace_with(out, query[[i]] & !replaced, value[[i]], NULL, error_call = error_call)

Read the original on github.com ↗