Issue #1354 revealed the following as a problem with error trapping:
> nestedNim2 <- nimbleFunction(
run = function(){
returnType(double(0))
return(nimGarbage())
}
)
[Note] For this nimbleFunction to compile, 'nimGarbage' must be defined as a nimbleFunction, nimbleFunctionList, or nimbleList before compilation.
> compileNimble(nestedNim2)
Compiling
[Note] This may take a minute.
[Note] Use 'showCompilerOutput = TRUE' to see C++ compilation details.
Error in if (typeEnv$return$type == "nimbleList" || code$args[[1]]$type == :
missing value where TRUE/FALSE needed
In contrast this is error-trapped, so the issue is with processing return().
> nestedNim2 <- nimbleFunction(
run = function(){
returnType(double(0))
out = nimGarbage()
return(out)
}
)
compileNimble(nestedNim2)
[Note] For this nimbleFunction to compile, 'nimGarbage' must be defined as a nimbleFunction, nimbleFunctionList, or nimbleList before compilation.
Compiling
[Note] This may take a minute.
[Note] Use 'showCompilerOutput = TRUE' to see C++ compilation details.
Error: In sizeAssignAfterRecursing: 'nimGarbage' is not available or its output type is unknown.
This occurred for: out = nimGarbage()
This was part of the call: {
out = nimGarbage()
return(out)
}
Issue #1354 revealed the following as a problem with error trapping:
In contrast this is error-trapped, so the issue is with processing
return()
.