Skip to content

Using @example path/to/example.R fails for R6 classes #1158

@jranke

Description

@jranke

My reprex package jranke:R6ExampleTest fails like this:

LANG=C Rscript -e 'roxygen2::roxygenize()'
Loading R6ExampleTest
Loading required package: R6
Error in file.path(base_path, x$val) : 
  cannot coerce type 'closure' to vector of type 'character'
Calls: <Anonymous> ... roxy_tag_rd -> roxy_tag_rd.roxy_tag_example -> file.path
Execution halted

I believe the cause of this bug is the same as for #1151, the character string base_path is not found, only the function base_path() as defined in https://github.com/r-lib/roxygen2/blob/master/R/collate.R#L71

Metadata

Metadata

Assignees

No one assigned

    Labels

    R6 6️⃣bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions