Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check_dots_empty() and missing arguments #1390

Closed
krlmlr opened this issue Apr 19, 2022 · 2 comments
Closed

check_dots_empty() and missing arguments #1390

krlmlr opened this issue Apr 19, 2022 · 2 comments
Labels
feature a feature request or enhancement tidyeval:dots

Comments

@krlmlr
Copy link
Member

krlmlr commented Apr 19, 2022

Can we support the "trailing comma" idiom with check_dots_empty(), the same way as we do in list() ?

fun <- function(..., a = NULL) {
  rlang::check_dots_empty()
}

# Expected
fun(1)
#> Error in `fun()`:
#> ! `...` must be empty.
#> x Problematic argument:
#> • ..1 = 1
#> ℹ Did you forget to name an argument?

# Expected
fun(a = 1)
#> NULL

# Unexpected
fun(
  a = 1,
)
#> Error in `fun()`:
#> ! `...` must be empty.
#> x Problematic argument:
#> • ..1 = <empty>
#> ℹ Did you forget to name an argument?

Created on 2022-04-19 by the reprex package (v2.0.1)

@lionel-
Copy link
Member

lionel- commented May 25, 2022

hmm I don't see why not. Any objections to this @hadley?

@lionel- lionel- added tidyeval:dots feature a feature request or enhancement labels May 25, 2022
@hadley
Copy link
Member

hadley commented May 25, 2022

Seems fine to me.

@lionel- lionel- closed this as completed in 7b49855 Jun 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement tidyeval:dots
Projects
None yet
Development

No branches or pull requests

3 participants