> nf <- nFunction(
fun = function(x = 'numericXXX') {
return(x/y)
}, returnType = 'numericVector'
)
cnf <- nCompile(nf)
An error occurred in compiler stage labelAbstractTypes (for method or nFunction nFun_24_NFID_28):
argument is of length zero
This occurred while: handling labelAbstractTypes for y.
Error in if (a1Type$nDim != a2Type$nDim) { : argument is of length zero
In addition: Warning message:
In max(a1Type$nDim, a2Type$nDim) :
no non-missing arguments to max; returning -Inf
In contrast, invalid returnType values give a reasonable error message:
An error occurred in compiler stage doImplementation:
argument is of length zero
This occurred while: handling eigenize for y.
Error in if (code$args[[i]]$type$type != resultType) { :
argument is of length zero
In addition: Warning message:
Object type for return() does not match the nFunction's return type.
This occurred for: return(x / y)
This was part of the call: {
return(x / y)
}
In contrast, invalid returnType values give a reasonable error message: