mllg / checkmate

Fast and versatile argument checks
https://mllg.github.io/checkmate/
Other
263 stars 30 forks source link

various `checkXYZ` functions permit `list()` ... should they? #200

Closed mmuurr closed 3 years ago

mmuurr commented 3 years ago

Example:

checkmate::checkCharacter(list())  ## returns TRUE

Since is.character(list()) is FALSE, I'd expect the check above to return FALSE, too.

I can easily add a checkAtomic check if needed, so I'm not really asking for any change, just curious about the logic. In fact, the current behavior makes one particular check easier: checking for decoded string arrays from jsonlite, since [] decodes to list(). (Perhaps that's exactly the type of example that motivated the current behavior?)

checmkate version 2.0.0.

tdeenes commented 3 years ago

See #174. Fixed in the devel version.