"no-unused-vars" rule false positive in inherited contracts
See original GitHub issueI get an [ERROR] At line: x, column: y -> Variable 'someAddress' is declared but never used.
in the scenario below, in which the variable is used in contracts inheriting from the base but not in the base contract itself.
contract IMyContract {
address public someAddress;
function myFunction(address someVariable);
}
import 'IMyContract.sol';
contract MyContract is IMyContract {
function someOtherFunction(address X)
{
someAddress = X;
}
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
typescript-eslint/no-unused-vars false positive in type ...
Question: What's wrong with this rule and why it triggers in this case. Why eslint recognizes type declaration for functions in types/interfaces ...
Read more >arXiv:1802.06038v2 [cs.CR] 14 Mar 2018
is determined as true or false positive, but the contract state on main blockchain is not affected since no changes.
Read more >Code Issues - Embold Help Center
DoNotHideInheritedMembers, On hiding an inherited member, the derived version of the ... If that is the case, the reported instance is a false...
Read more >Diff - 402e1b6e55e9041dfd1a93580e45e5c5dba1db55^!
Unless required by applicable law or + agreed to in writing, ... 2016 + +* 27700cf Fix: `no-unused-vars` false positive around callback ...
Read more >Why and How JavaScript Developers Use Linters
3.4 False Positives in Static Analysis Tools . ... mentioned the importance of the rule no-unused-vars (identifies variables that have been.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
this issue no longer persists since solium does not check state variables for usage any more. feel free to re-open in case you face this (or something similar).
Ahh! When I test the whole code in a single file, it doesn’t pose any errors.
You must’ve declared
IMyContract
in 1 file, andMyContract
in another. At a time, Solium lints only a single file, so it is not informed whether you are using the variable in some other file or not.This needs fixing.