Here's a case where we should explicitly say that y is not found.
go = nFunction(
fun = function(x = 'numericVector') {
for(i in 1:length(y)) {}
})
cgo <- nCompile(go)
An error occurred in compiler stage labelAbstractTypes (for method or nFunction nFun_10_NFID_14):
argument is of length zero
This occurred while: handling labelAbstractTypes for y.
Error in if (code$args[[1]]$type$nDim >= 2) { :
argument is of length zero
I will note that in other scenarios we do better messaging, so there's probably something about the nesting that needs to be investigated.
go = nFunction(
fun = function(x = 'numericVector') {
y <- z
})
cgo <- nCompile(go)
An error occurred in compiler stage labelAbstractTypes (for method or nFunction nFun_9_NFID_13):
variable 'z' has not been created yet.
This occurred while: handling labelAbstractTypes for z.
Error: variable 'z' has not been created yet.
Here's a case where we should explicitly say that
yis not found.I will note that in other scenarios we do better messaging, so there's probably something about the nesting that needs to be investigated.