pars(terms =) now reports as defunct for every input type - #109
Merged
Merged
Conversation
… `term` vectors (#108) Only `pars.term()` carried `terms` as a formal, so `pars.default()`, `pars.character()` and `pars.term_rcrd()` absorbed it into `...` and failed with "`...` must be unused", which named neither the defunct argument nor the `pars_terms()` replacement. 0.4.0 escalated this argument to a hard error, so this is exactly when call sites are being migrated. Intercept `terms` in `...` before `chk_unused()` and raise the same `deprecate_stop()` error. Kept narrow: other unused arguments still report as unused, covered by a test. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Closes #108
Only
pars.term()carriedtermsas a formal, so every other method absorbed it into...and failed withchk_unused()'s message, which named neither the defunct argument nor its replacement:0.4.0 escalated this argument from a warning to a hard error, so this is precisely when people are migrating call sites. Character input is the likely case in practice, since
pars()accepts it directly.Approach
stop_defunct_terms()checks...names()fortermsand raises the samedeprecate_stop()error. It is called beforechk_unused()inpars.default(),pars.character()andpars.term_rcrd();pars.term()is unchanged, as its formal already handles it.Intercepting
...rather than adding atermsformal to the other three methods keeps the defunct argument out of their signatures and so out of their\usagesections....names()needs R >= 4.1, whichDESCRIPTIONalready requires.Verification
All five input paths now give the same message:
pars(term("a[1]"), terms = TRUE)pars(term("a[1]"), terms = FALSE)pars(c("a[1]"), terms = TRUE)...must be unusedpars(as_term_rcrd(...), terms = TRUE)...must be unusedpars(matrix(1:4, nrow = 2), terms = TRUE)...must be unusedThe change is deliberately narrow, and a second test pins that down: genuinely unused arguments still report as unused.
devtools::test()574 pass, 0 fail.devtools::check()0 errors, 0 warnings, 0 notes.Notes
NEWS.mdis fledge-generated, so it is not edited here; the commit subject is written to serve as the release note.Out of scope, but worth a look separately:
npdims()had its owntermsargument retired in 0.3.0 and carries no equivalent handling, so it may have the same gap.