Closed paciorek closed 11 months ago
This is occurring in nfProcessing$evalNewSetupLinesOneInstance
.
Perhaps more concerningly, we also have a scoping problem here. If one sets i
in the global env, then the eval
will use it.
I'm adding a check in the getParam
keyword processor to make sure that all vars in the param
expression are found in the nfProc
symbol table.
One note is the uncompiled execution will still look for i
(in the example) in run
and then outside of the nimbleFunction if not otherwise found.
Confusingly I named the branch fix_1144
.
Trapped in PR #1370
Here's a user's code where they were trying to parameterize usage of
getParam
. They're trying to use positional value as the second arg, but even if trying to use a vector of strings, the issue still occurs. It's occurring because we are creating new setup code and eval'ing it in the context of the an environment in whichi
is not defined/meaningful.We should give a better error message. But we might also want to think more about what the user is trying to do.