Closed robertzk closed 9 years ago
My R version is 3.0.2 and my R6 version is 2.1.0.
I have replicated the issue in the simplest case when
engine_class <- R6::R6Class("engine", portable = TRUE, inherits = director:::director_)
Do any of the fields in director_
contain reference objects? Might be related to this:
https://cran.r-project.org/web/packages/R6/vignettes/Introduction.html#fields-containing-reference-objects.
Interesting! I did not know about that behavior, although that was not it. I was actually refactoring director_
from refClass to R6, and it seems I forgot a few self
references, so it was setting global variables instead! One-line utility methods that didn't have test coverage.
Thanks for the fast response.
It makes sense to store the initial default values in the R6 definition, so the reference-type member initializer issue makes sense; reminds me of the care needed around python default arguments.
Oh yeah, I've been bitten by the <<-
assignment before.
I am having a very bizarre issue. I have a complicated R6 class called
director
that is being subclassed in another package, where it is calledengine
(sodirector
is portable in package A andengine
inherits fromdirector
in package B). I see the following behavior.Should I look further into my
director
object definition and strive to produce a minimal reproducible example, or could this be an R6 issue, and do you have any ideas for how to start debugging this?