Open t-kalinowski opened 1 month ago
I thought I noticed that too, but it turned out that I was accidentally duplicating method definitions.
I don't think I'm defining the method twice. A minimal package with just this is enough to show the warning twice:
#' @import S7
NULL
method(convert, list(class_double, class_integer)) <-
function(from, to, ...) as.integer(from)
.onLoad <- function(...) {
S7::methods_register()
}
> devtools::load_all(".")
ℹ Loading r2f
Overwriting method convert(<double>, <integer>)
Overwriting method convert(<double>, <integer>)
Ooh, hmmmm, maybe it only occurs in the dev version?
I've noticed this too when redefining methods at runtime during debugging, like with ESS's developer mode. It's a bit distracting.
This might be better as a
pkgload
specific issue, but I'm raising it here first. In a package that exports methods,load_all()
gets annoyingly noisy.Note that each method is overwritten twice: once when sourcing the package code, and then again in
.onLoad
/S7::methods_register()
.