Eliminate duplicate tests when function parameters are defined #2654
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.
Fixes #2647
When AGS code defines a parameter within a function header and a body follows then that parameter can hide or collide with global definitions. Code for these checks is already provided where the compiler processes local variable defns. So no need to duplicate the checks where the compiler processes parameter definitions – delete these checks.
This fixes a bug : These checks were even done when a function body doesn't even follow (i.e., for an import or forward declaration of a function), which is incorrect and makes for strange warnings.
Example code:
Provide googletests that demonstrate that the bug is fixed.