Skip to content

extend with sourced module with use returns error #16

@krystian8207

Description

@krystian8207

Hi @wahani. Thank you for the great package!

I've found one issue while trying to use extend function with module sourced from the file.

Reproducible example:

# module.R
export("bar")
bar <- function() "bar"
foo <- function() "foo"

When sourcing the module with use and trying to extend it:

test_module <- use("module.R")
extend(
  test_module, {
  stopifnot(foo() == "foo") 
})

I get:

Error in parse(text = c("{", originalExpr, additionalExpr, "}")) : 
  <text>:3:41: unexpected '<'
2: structure(expression(export("bar"), bar <- function() "bar", 
3:     foo <- function() "foo"), srcfile = <
                                           ^

I'd be happy if you could take a closer look at it. Thank you.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions