Fix snapshot test for warn_dots_used()#6830
Open
lionel- wants to merge 1 commit intotidyverse:mainfrom
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 theggplot()frame here:ggplot2/R/plot.R
Line 112 in c02c05a
fortify()is called and passes"nonsense"via...to theNULLmethod:ggplot2/R/plot.R
Line 126 in c02c05a
The
NULLmethod returns to the generic, which checks for dots used here, hitting the new rlang behaviour:ggplot2/R/fortify.R
Line 14 in c02c05a
The workaround implemented in this PR is to explicitly pass
data = NULLtoggplot()to avoid forcing the promise on dispatch.