Closed jonthegeek closed 1 year ago
Would you mind providing a basic package reprex?
Sure, I'll put something together, including the failed check.
https://github.com/jonthegeek/S7primitivereprex/actions/runs/6149344761/job/16685015875?pr=1
Somewhat shockingly, I had to include the R/S7primitivereprex-package.R
file (or possibly specifically the corresponding Rd) to get the error, specifically this piece:
#' @keywords internal
"_PACKAGE"
I hope that helps track it down!
You just need one documentation file to be present, which I guess isn't too surprising given that the error comes from the "checking for code/documentation mismatches" check.
I see the same problem when registering a method for mean()
, so it doesn't appear to be just related to primitives.
You can see the problem more easily with tools::codoc("S7primitivereprex", ".")
A bit of rlang gymnastics yields a back trace for the warning:
▆
1. ├─base::withCallingHandlers(...)
2. ├─tools::codoc("S7primitivereprex", ".")
3. │ └─base::lapply(functions_in_S3Table, function(f) formals(S3Table[[f]]))
4. │ └─tools (local) FUN(X[[i]], ...)
5. │ └─base::formals(S3Table[[f]])
And it's calling it with S3Table[[".S7_methods"]]
which is added by external_methods_add()
.
@jonthegeek thanks for trying S7 out and reporting these problems!
Happy to help! I'd been trying to decide how to structure a data--of-a-particular-shape-focused package, and S7 appeared on CRAN just in time 😊
I'm not sure how to reprex this, because so far I only see the issue inside R CMD Check. This is the warning I get:
I got it by trying to define a
length
method.S7::method(length, rapid) <- function(x) length(x@info)
It otherwise works with the dev version of S7 (but fails with the CRAN version).
I'm assuming that it's somehow related to length being a primitive rather than an actual S3 generic, but beyond that I'm not sure where to look.