-
Notifications
You must be signed in to change notification settings - Fork 237
Closed
Labels
Milestone
Description
thanks so much for #' @inheritDotParams; it's a fantastic addition.
Though I couldn't find documentation for this, it appears that you can currently use only one #' @inheritDotParams per documentation entry.
When, all other things equal, I try to add two such tags for the same function, I get this error message:
Writing NAMESPACE
Error in mapply(FUN = f, ..., SIMPLIFY = FALSE) :
zero-length inputs cannot be mixed with those of non-zero length
Calls: suppressPackageStartupMessages ... topics_process_inherit -> <Anonymous> -> fun -> Map -> mapply
Is this a known/intended limitation of #' @inheritDotParams?
My use case is something like this:
#' Do something
#' Does something
#' @param x [`character(1)`] very interesting text.
#' @inheritDotParams lower_level_fun_a -x
#' @inheritDotParams lower_level_fun_b -x
higher_level_fun(x, ...) {
lower_level_fun_a(x, ...)
lower_level_fun_b(x, ...)
}
#' Do a
#' Does a
#' @param foo a very fooish character
lower_level_fun_a(x, foo = "zap") {
print(x, foo)
}
#' Do b
#' Does b
#' @param bar a very booish character
lower_level_fun_b(x, bar = "zong") {
print(x, zong)
}
I understand that passing on ... to multiple functions is a bit risky, because if arguments carry the same names, they get matched twice (intended here).
But if this seems safe to the dev, multiple #' @inheritDotParams could save a lot of typing.
llrs, schradj and gustavdelius