rlang
rlang copied to clipboard
`eval_tidy()` with `...` in two-sided formula
rlang::eval_tidy(... ~ 1)
#> Error in rlang::eval_tidy(... ~ 1) : '...' used in an incorrect context
rlang::eval_tidy(1 ~ ...)
Error in rlang::eval_tidy(1 ~ ...) : '...' used in an incorrect context
Causes trouble with data.table: https://github.com/rstudio/shiny/issues/3303 and https://github.com/Rdatatable/data.table/issues/4913
This is a limitation of R.
tilde <- function(x, y) list(substitute(x), substitute(y))
tilde(1, ...)
#> Error: '...' used in an incorrect context
ignore <- function(x, y) NULL
ignore(1, ...)
#> Error: '...' used in an incorrect context
The argument application routine of the interpreter checks that the calling environment has dots: https://github.com/wch/r-source/blob/2ab3b85b/src/main/eval.c#L3203-L3204 Only SPECIALSXP
functions like ~
can be supplied ...
without this check.
One way forward is #1145.