Skip to content

Conversation

@davidBar-On
Copy link
Contributor

@davidBar-On davidBar-On commented Jun 18, 2023

Fixes #10155

Suggested solution for remove warning messages that Free functions shadow Interface functions.
As I wrote in this comment, it may be considered to extended the solution to other declaration types inside an Interface, such as struct and enum.

(Note: only after submitting the PR I noticed that the "good first issue" label was remove, so the PR may be redundant. As I hope that the changes are useful I keep the PR open.)

@github-actions
Copy link

Thank you for your contribution to the Solidity compiler! A team member will follow up shortly.

If you haven't read our contributing guidelines and our review checklist before, please do it now, this makes the reviewing process and accepting your contribution smoother.

If you have any questions or need our help, feel free to post them in the PR or talk to us directly on the #solidity-dev channel on Matrix.

@davidBar-On davidBar-On force-pushed the issue-10155-interface-declaration-shadows-file-level-declaration branch from a8e58e2 to 35fb499 Compare June 20, 2023 12:31
@NunoFilipeSantos
Copy link
Contributor

We will try to review it soon.

@ekpyron
Copy link
Collaborator

ekpyron commented Jan 8, 2024

This would need a rebase, a changelog entry, and some brushing up of the test coverage would also be nice, but generally, we could merge this.

@davidBar-On davidBar-On force-pushed the issue-10155-interface-declaration-shadows-file-level-declaration branch from 35fb499 to 3b7cd2b Compare January 26, 2024 15:30
@TonyVernocchi
Copy link

I've reviewed the changes related to the new isParentInterface flag in AST.h and the updates in ASTJsonImporter.cpp and Parser.cpp. These modifications seem to effectively differentiate between interface and free functions, which should improve the handling of shadowing during parsing and analysis.

I have a question about potential edge cases. How does this approach handle situations where a free function might have the same name as an interface function and also inherit some of its modifiers? Are there any specific checks in place to avoid unexpected behavior in such scenarios?

Additionally, while the code changes seem well-implemented, including a few unit tests that specifically cover interface function shadowing could further strengthen the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

File level functionname shadows functionname in Interface

4 participants