rlang icon indicating copy to clipboard operation
rlang copied to clipboard

list2() doesn't evaluate arguments in way ellipsis::check_dots_used() checks

Open yutannihilation opened this issue 4 years ago • 2 comments

f <- function(...) {
  ellipsis::check_dots_used()
  purrr::list_modify(list(a = 1), ...)
}

f(a = 2)
#> Error: 1 components of `...` were not used.
#> 
#> We detected these problematic arguments:
#> * `a`
#> 
#> Did you misspecify an argument?

yutannihilation avatar Jan 29 '20 15:01 yutannihilation

Simpler reprex:

f <- function(...) {
  ellipsis::check_dots_used()
  list2(...)
}

f(a = 2)
#> Error in list2(...): could not find function "list2"
#> Error: 1 components of `...` were not used.
#> 
#> We detected these problematic arguments:
#> * `a`
#> 
#> Did you misspecify an argument?

Created on 2020-05-15 by the reprex package (v0.3.0)

I'm going to move to rlang since that's where any fix would have to happen (I think)

hadley avatar May 15 '20 12:05 hadley

Another one (I believe could not find function "list2" error is not intended):

library(rlang)

f <- function(...) {
  ellipsis::check_dots_used()
  list2(...)
}

f(a = 2)
#> Error: 1 components of `...` were not used.
#> 
#> We detected these problematic arguments:
#> * `a`
#> 
#> Did you misspecify an argument?

Created on 2020-05-16 by the reprex package (v0.3.0)

yutannihilation avatar May 16 '20 06:05 yutannihilation