Skip to content

@inheritParams with comma-separated parameters #1718

@ms609

Description

@ms609

@inheritParams does not inherit any parameters whose definition is shared, via a comma, with \dots.

#' Foo
#' @param a A variable.
#' @param b,\dots Parameters to pass to `SomeFunc()`.
#' @export
foo <- function (a, b, ...) {}

# Inherits 'a' successfully.
# Does not inherit 'b' or '\dots'
#' Bar
#' @inheritParams foo
#' @export
bar <- function(a, b, ...) {}

# Does not inherit 'b'
#' Bar with own dots parameter
#' @inheritParams foo
#' @param \dots Document dots separately
#' @export
bardot <- function(a, b, ...) {}

Result:

> devtools::check_man()
ℹ Updating documentation
Writing NAMESPACE
Writing foo.Rd
Writing bar.Rd
Writing bardot.Rd
ℹ Checking documentation...
Undocumented arguments in Rd file 'bar.Rd'
  ‘b’ ‘...’

Undocumented arguments in Rd file 'bardot.Rd'
  ‘b’

Potentially related? #1670

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions