On 11/05, Robert Dewar wrote:
OK, I see the issue you were raising, in general F(3) is fine, but
in this case F(3) is no good since F is a local function.
The rule really has to be that the prefix of Old may not
mention any local entities (other than parameters of the
function in which it appears). I think what is needed is
a scan of the tree using the usual traversal routine to
make sure this rule is followed.
Yup, this was my point, the prefix must be checked or its initial analysis
changed, but the latter might prove difficult because its scope is the
scope above the subprogram augmented with the subprogram formals. So I
guess a deep check is the easiest solution.