-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The comprehensive-interface rule results in compiler warning: Interface functions are implicitly "virtual" #519
Comments
It's not possible to disable Solidity compiler warnings so I believe the Solidity compiler is out-of-line here -- warning about the potentially redundant |
Perhaps the |
Probably this rule used to be helpful before override was removed as a requirement for functions implementing interfaces: ethereum/solidity#8281. |
My plan for the workaround is to use this rule temporarily to help me find all the public functions and ensure they are all declared in interfaces. Once all functions are in interfaces, I can replace all contract interactions from hardhat tests to use the interfaces. This should ensure new public functions are not added without declaring them in the interface. |
The |
@ncjones thanks a lot for your input and for taking the time to research possibilities on top of pointing the issue alone |
@ncjones the way solhint works cannot check the interfaces associated to the contracts. So that idea cannot be implemented. You can also tried to inherit the interface and define the contract with that interface:
This will check that all public and external functions are in the interface |
I want to make sure all our public functions are carefully considered and well documented. The
comprehensive-interface
Solhint rule helps me to achieve this.The problem I am facing is that the way this rule is implemented requires me to use the
override
keyword but the Solidity compiler doesn't like this to be used with interfaces.When I add
override
without a correspondingvirtual
on my interface function then the compiler errors:When I address the compiler error by adding
virtual
to the interface function then the compiler produces a warning:Solidity version: 0.8.21
Solhint version: 3.6.2
The text was updated successfully, but these errors were encountered: