Report deprecation error on functions sha3 and suicide also without call.

This commit is contained in:
Leonardo Alt
2018-11-29 14:29:13 +01:00
parent 6b11ef1887
commit 67bbcefe6c
9 changed files with 76 additions and 22 deletions
@@ -8,5 +8,5 @@ contract test {
}
}
// ----
// TypeError: (58-66): "sha3" has been deprecated in favour of "keccak256"
// TypeError: (101-152): "suicide" has been deprecated in favour of "selfdestruct"
// TypeError: (58-62): "sha3" has been deprecated in favour of "keccak256"
// TypeError: (101-108): "suicide" has been deprecated in favour of "selfdestruct"
@@ -0,0 +1,8 @@
contract C
{
function f(bytes memory data) public pure {
sha3;
}
}
// ----
// TypeError: (60-64): "sha3" has been deprecated in favour of "keccak256"
@@ -0,0 +1,11 @@
contract C
{
function sha3() public pure returns (bool) {
return true;
}
function f() public pure returns (bool) {
return sha3();
}
}
// ----
// Warning: (14-76): This declaration shadows a builtin symbol.
@@ -0,0 +1,9 @@
contract C
{
function f() public pure returns (bool) {
bool sha3 = true;
return sha3;
}
}
// ----
// Warning: (58-67): This declaration shadows a builtin symbol.
@@ -0,0 +1,8 @@
contract C
{
function f(bytes memory data) public pure {
suicide;
}
}
// ----
// TypeError: (60-67): "suicide" has been deprecated in favour of "selfdestruct"
@@ -0,0 +1,11 @@
contract C
{
function suicide() public pure returns (bool) {
return true;
}
function f() public pure returns (bool) {
return suicide();
}
}
// ----
// Warning: (14-79): This declaration shadows a builtin symbol.
@@ -0,0 +1,9 @@
contract C
{
function f() public pure returns (bool) {
bool suicide = true;
return suicide;
}
}
// ----
// Warning: (58-70): This declaration shadows a builtin symbol.