my class professor and me recently discovered a bug in the error messages of the assert() - function. When one includes several checks of different variables and set combine to "and", the error message will always use the variable of the first check() for the error message. This bug is caused by this code junk:
Hello,
my class professor and me recently discovered a bug in the error messages of the assert() - function. When one includes several checks of different variables and set combine to "and", the error message will always use the variable of the first check() for the error message. This bug is caused by this code junk:
"1L" needs to be replaced by "i".
A short example of the effect of this bug:
char <- "abc" num <- 123 bin <- "nobinary"
checkmate::assert(checkmate::check_character(char), checkmate::check_number(num), checkmate::check_flag(bin), combine = "and")
the function will throw the following error: "Fehler: Assertion on 'char' failed. Must be of type 'logical flag', not 'character'."
should be: "Fehler: Assertion on 'bin' failed. Must be of type 'logical flag', not 'character'."
instead.
Matrix products: default
locale: [1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252 LC_MONETARY=German_Germany.1252 [4] LC_NUMERIC=C LC_TIME=German_Germany.1252
attached base packages: [1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached): [1] compiler_4.0.2 backports_1.2.0 tools_4.0.2 checkmate_2.0.0