Skip to content

Fix snapshot test for warn_dots_used()#6830

Open
lionel- wants to merge 1 commit intotidyverse:mainfrom
lionel-:rlang-fix
Open

Fix snapshot test for warn_dots_used()#6830
lionel- wants to merge 1 commit intotidyverse:mainfrom
lionel-:rlang-fix

Conversation

@lionel-
Copy link
Copy Markdown
Member

@lionel- lionel- commented Apr 1, 2026

rlang now uses the new R API for environments and dots to figure out whether a promise is forced or not: r-lib/rlang#1880. One concrete change from this is that we can only see the state of the final promise in a promise chain, which causes a revdep failure with ggplot2 (r-lib/rlang#1891).

Here is the flow:

  • ggplot(foobar = "nonsense") dispatches on the first argument, in this case "nonsense". This forces the promise in the ggplot() frame here:

    UseMethod("ggplot")

  • fortify() is called and passes "nonsense" via ... to the NULL method:

    data <- fortify(data, ...)

  • The NULL method returns to the generic, which checks for dots used here, hitting the new rlang behaviour:

    warn_dots_used()

The workaround implemented in this PR is to explicitly pass data = NULL to ggplot() to avoid forcing the promise on dispatch.

@lionel- lionel- mentioned this pull request Apr 1, 2026
11 tasks
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

Successfully merging this pull request may close these issues.

1 participant