Bugfix: Do not mangle overridden non-overloaded virtual function names #1624
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.
Closes #1623
The basic idea of the algorithm checking whether a function name is eligible for mangling or not is to mangle the name if that function is publicly callable but the functions name appears multiple time in the contract. But this doesn't account for virtual functions also appearing more than one time in the same contract if they are overridden. With this PR, we bail early if the function we are checking overrides, marking only the single one non-overriding implementation as eligible for mangling. Consequently, functions which override but do not overload are no longer unnecessarily mangled.