Encountering a problem with compiling nimbleFunctions that reference other nimbleFunctions in my package.
I've reduced this to a relatively minimal example:
nimNothing <- nimbleFunction(
run = function(){
returnType(double(0))
return(0)
})
#' @export
nestedNim <- nimbleFunction(
run = function(){
returnType(double(0))
return(nimNothing())
}
)
When I attempt to `compileNimble` the `nestedNim` nimbleFunction, specifically as part of an .Rmd vignette, I get errors. When I load them via `devtools::load_all` it works fine. To reproduce: put these two functions in an R file in a new package, create a vignette that compiles the `nestedNim` function, and call `devtools::build_rmd(...)` to build your vignette. The specific error that I am getting with this is:
Error in if (typeEnv$return$type == "nimbleList" || code$args[[1]]$type == : missing value where TRUE/FALSE needed
But I suspect that this is something of a red herring, as I was getting an entirely different error before reducing this to a minimal example. If you `devtools::load_all()` and then just "Run" the .Rmd file in RStudio, everything works. Attached is a package with the described setup.