r-lib / rlang

Low-level API for programming with R
https://rlang.r-lib.org
Other
489 stars 131 forks source link

in standalone-types-check,`check_number_whole()` `min` and `max` don't accept integer. #1702

Open olivroy opened 2 months ago

olivroy commented 2 months ago
rlang:::check_number_whole(2, max = 3L)
#> Error 
#> ! `max` must be a single double value.

But my use case was that max = length(something) which is integer, and triggered this unfriendly error.

Is there something rlang can do that will not affect performance.

For what it's worth, I think it would still be valid to accept integer for check_number_decimal() too.