Fixes #155, fixes #94, fixes #133. The latter two issues are that when cloning an object with a function that is not a method, the new object would turn it into a method, and alter the environment.
This now works:
A <- R6Class("A",
public = list(
f = NULL
)
)
a <- A$new()
self <- 1
a$f <- function() self
expect_identical(a$f(), 1)
a2 <- a$clone()
expect_identical(a2$f(), 1)
@thomasp85, @cpsievert, I believe you guys asked about this in an issue in another repo, but I can't remember where it was.
Fixes #155, fixes #94, fixes #133. The latter two issues are that when cloning an object with a function that is not a method, the new object would turn it into a method, and alter the environment.
This now works:
@thomasp85, @cpsievert, I believe you guys asked about this in an issue in another repo, but I can't remember where it was.