Merge pull request #6028 from ethereum/warn-about-unused-struct-array-expr

Detect custom type expressions that have no effect
This commit is contained in:
Alex Beregszaszi
2019-02-18 21:12:04 +00:00
committed by GitHub
9 changed files with 25 additions and 0 deletions
@@ -4,3 +4,4 @@ contract Test {
}
}
// ----
// Warning: (78-88): Statement has no effect.
@@ -2,3 +2,5 @@ contract test {
uint256 variable;
function f(uint256) public returns (uint out) { f(variable); test; out; }
}
// ----
// Warning: (103-107): Statement has no effect.
@@ -0,0 +1,16 @@
contract test {
struct s { uint a; uint b;}
function f() pure public returns (byte) {
s;
s(1,2);
s[7];
uint;
uint[7];
}
}
// ----
// Warning: (93-94): Statement has no effect.
// Warning: (98-104): Statement has no effect.
// Warning: (108-112): Statement has no effect.
// Warning: (116-120): Statement has no effect.
// Warning: (124-131): Statement has no effect.