don't descend into the referent function when validating a function call
I think this was a (benign) mistake in the original code. The generic traversal logic correctly considers the target of a function call to effectively be a weak reference and not something eligible for traversal. However, the validation traversal *would* descend into this target. The target function has already been validated because it occurred lexically previously in the AST. Therefore descending into it simply duplicates validation work that has already occurred. The motivation for discovery of and removal of this -- perhaps surprisingly -- is work to support recursive functions. A naive attempt at supporting recursive functions trips over the target of a function call being incomplete: If a function call is permitted to resolve to the containing function, it finds a version of that function containing an unresolved function call (itself). Later validation of this target function fails due to the unresolved call. There's no proper solution for this, in that the whole thing is caused by a pattern of circular references. However, following this commit, we can probably live with a slightly incomplete version of the function in FunctionCall::function.
parent
6061c595
Please register or sign in to comment