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

False positive inside generic #8

Closed
hadley opened this issue Feb 18, 2019 · 1 comment
Closed

False positive inside generic #8

hadley opened this issue Feb 18, 2019 · 1 comment

Comments

@hadley
Copy link
Member

@hadley hadley commented Feb 18, 2019

as_factor <- function(x, ...) {
  ellipsis::check_dots_used()
  UseMethod("as_factor")
}

as_factor.character <- function(x, ..., y)  {
  force(y)
  x
}
as_factor("x", y = 1)
#> Warning: Some components of ... were not used: y
#> [1] "x"

Created on 2019-02-18 by the reprex package (v0.2.1.9000)

@hadley
Copy link
Member Author

@hadley hadley commented Feb 18, 2019

Doesn't seem restricted to generics:

f <- function(x, ...) {
  ellipsis::check_dots_used()
  g(x, ...)
}

g <- function(x, ..., y)  {
  force(y)
  x
}
f("x", y = 1)
#> Warning: Some components of ... were not used: y
#> [1] "x"

Created on 2019-02-18 by the reprex package (v0.2.1.9000)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant