Skip to content

Commit c38882f

Browse files
committed
try setting R6interface parent_env to the uncompiled parent_env with an extra layer
1 parent 8d951ab commit c38882f

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

nCompiler/R/NC_FullCompiledInterface.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
#' @export
5656
build_compiled_nClass <- function(NCgenerator,
5757
newCobjFun,
58-
env = parent.frame(),
58+
env = NCgenerator$parent_env,
5959
quoted = FALSE) {
6060
# One might wonder if we can have an R6 class created here to
6161
# interface with a compiled C++ class be established with

nCompiler/R/nCompile.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,8 +670,8 @@ nCompile_finish_nonpackage <- function(units,
670670
} else {
671671
if(expect_createFromR[i]) createFromR_fun <- compiledFuns[[iRes]]
672672
R6interfaces[[i]] <- try(build_compiled_nClass(units[[i]],
673-
createFromR_fun,
674-
env = resultEnv))
673+
createFromR_fun))
674+
# env = resultEnv))
675675
if(inherits(R6interfaces[[i]], "try-error")) {
676676
warning(paste0("There was a problem building a full nClass interface for ", exportNames[i], "."))
677677
R6interfaces[[i]] <- NULL

0 commit comments

Comments
 (0)