Skip to content

Fix self-referential error_call default in section_topics - #3022

Open
sims1253 wants to merge 1 commit into
r-lib:mainfrom
sims1253:fix/ry-audit-round2
Open

sims1253 wants to merge 1 commit into
r-lib:mainfrom
sims1253:fix/ry-audit-round2

Conversation

@sims1253

Copy link
Copy Markdown

section_topics() declared its error context as:

section_topics <- function(
  pkg,
  match_strings,
  error_path,
  error_call = error_call()
)

The default refers to the argument it initializes. If the function is called without an explicit error_call, evaluating the default fails with "promise already under evaluation: a default argument referenced itself".

The default is now caller_env(), which is the convention select_topics(), all_sign(), and match_eval() in the same file already use.

Found during my most recent ry audit.

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