insightsengineering / insightsengineering/teal.code
qenv.error: cannot add bindings to a locked environment when evaluating qenv code:
- Lingua principale
- R
- Stelle
- 12
- Fork
- 11
- Merge medio
- 1g 17h
- PR unite (30g)
- 1
Descrizione
### What happened?
When creating an S4 class inside `eval_code` you get an error that you `cannot add bindings to a locked environment`
```r
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
```
```r
```
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Start at the eval_code() entry point and run the reproducible example from the issue, including the setClass() call and subsequent S4 assignments. Trace how the evaluation environment is created or locked; done means the example evaluates without the qenv.error about adding bindings to a locked environment.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- r
- Ambito
- tooling
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100