Ignore function node IDs not found when validating parent initializer calls #1137
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background:
When checking for issues in parent initializer calls according to #1095, we recursively check initializer functions and the functions that they call.
When an function calls a built-in function, the referenced AST node ID of the built in function may be negative (which was fixed in #1116), or it could be represented as a large positive number as reported in #1128.
We previously only ignored negative numbers, but since there is no way to conclusively identify that a large positive number is negative, we should also ignore when the referenced function node ID is not found.
Testing:
I tested that this works by temporarily removing the checks for negative node IDs and allowing the new error handling to ignore the error. However, we should still keep the checks for negative node IDs for efficiency purposes (e.g. no need to dereference if we know that the id is negative and will not be found).
Fixes #1128