Skip to content

qenv.error: cannot add bindings to a locked environment when evaluating qenv code: #178

Open
@m7pr

Description

@m7pr

What happened?

When creating an S4 class inside eval_code you get an error that you cannot add bindings to a locked environment

library(teal.data)
library(teal.code)
code <- c(
  "setClass('aclass', slots = c(a = 'numeric', x = 'numeric', y = 'numeric')) # @linksto a x",
  "x <- new('aclass', a = 1:3, x = 1:3, y = 1:3)",
  "a <- new('aclass', a = 1:3, x = 1:3, y = 1:3)",
  "a@x <- a@y",
  "a@x <- a@x + 2",
  "a@x <- x@a"
)
tdata <- eval_code(teal_data(), code)
tdata
<qenv.error: cannot add bindings to a locked environment 
 when evaluating qenv code:
setClass("aclass", slots = c(a = "numeric", x = "numeric", y = "numeric"))>

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcore

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions