-
-
Notifications
You must be signed in to change notification settings - Fork 836
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
Warning about unused function parameters and imports #3272
Comments
I don't think I agree with this one as much, there are definitely times where you need to implement a specific interface, but a parameter isn't useful |
right, but this could be solved using the following syntax: @external
@pure
def test(uint256) -> uint256:
return 1 No named parameter (in this case |
That requires modifying a fair bit of the processing path for args, and also really isn't python syntax A better way would be just prepend with |
Right makes sense to keep Python consistency. We could do both: using |
Adding this as a note: _: uint256
@external
def test() -> uint256:
_:uint256 = 12
return _
@external
def bar(_:uint256) -> (uint256,uint256):
return (_,self._) Might also be good to prevent it anyway now that I think about it. |
Yes good catch - |
I think it is worth discussing whether these Quality-of-Life improvements are better handled by downstream tooling such as https://github.com/AlbertoCentonze/natrix. The rationale is that we do not want to saddle the compiler with maintaining these non-critical features. |
#4447 related -- i think this may be the best path forward since we don't need to decide whether making something a warning is worth it or not, we just issue the warning and the user also has the option to quash or promote the warning. |
Also related to #2431. Can we make sure that the compiler issues a warning for unused imports and function parameters? I think it would be a good idea in order to improve the quality and cleanliness of the code.
Example: Function Parameters
For instance here, the compiler should issue a warning that
owner
is not used.Example: Imports
For instance here, the compiler should issue a warning that
workhorse
is not used.The text was updated successfully, but these errors were encountered: