Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
m7pr opened this issue Nov 28, 2023 · 0 comments
Labels
bug Something isn't working core

Comments

@m7pr
Copy link
Contributor

m7pr commented Nov 28, 2023

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"))>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core
Projects
None yet
Development

No branches or pull requests

2 participants