diff options
author | Leonardo Alt <leo@ethereum.org> | 2018-11-29 17:05:52 +0800 |
---|---|---|
committer | Leonardo Alt <leo@ethereum.org> | 2018-11-29 21:29:13 +0800 |
commit | 67bbcefe6c104d60b42d35c61d42fb979f69fe89 (patch) | |
tree | 2f0a0f6b33bdabcb8fe70ed9aeb02f46086ee717 /test/libsolidity/syntaxTests | |
parent | 6b11ef188739302bc9a2a553aee25a172325e0be (diff) | |
download | dexon-solidity-67bbcefe6c104d60b42d35c61d42fb979f69fe89.tar.gz dexon-solidity-67bbcefe6c104d60b42d35c61d42fb979f69fe89.tar.zst dexon-solidity-67bbcefe6c104d60b42d35c61d42fb979f69fe89.zip |
Report deprecation error on functions sha3 and suicide also without call.
Diffstat (limited to 'test/libsolidity/syntaxTests')
7 files changed, 58 insertions, 2 deletions
diff --git a/test/libsolidity/syntaxTests/deprecated_functions.sol b/test/libsolidity/syntaxTests/deprecated_functions.sol index 62dfcff9..c5764e96 100644 --- a/test/libsolidity/syntaxTests/deprecated_functions.sol +++ b/test/libsolidity/syntaxTests/deprecated_functions.sol @@ -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" diff --git a/test/libsolidity/syntaxTests/globalFunctions/sha3_no_call.sol b/test/libsolidity/syntaxTests/globalFunctions/sha3_no_call.sol new file mode 100644 index 00000000..37b60e5e --- /dev/null +++ b/test/libsolidity/syntaxTests/globalFunctions/sha3_no_call.sol @@ -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" diff --git a/test/libsolidity/syntaxTests/globalFunctions/sha3_override.sol b/test/libsolidity/syntaxTests/globalFunctions/sha3_override.sol new file mode 100644 index 00000000..909c2dc3 --- /dev/null +++ b/test/libsolidity/syntaxTests/globalFunctions/sha3_override.sol @@ -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. diff --git a/test/libsolidity/syntaxTests/globalFunctions/sha3_var.sol b/test/libsolidity/syntaxTests/globalFunctions/sha3_var.sol new file mode 100644 index 00000000..19ee72d9 --- /dev/null +++ b/test/libsolidity/syntaxTests/globalFunctions/sha3_var.sol @@ -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. diff --git a/test/libsolidity/syntaxTests/globalFunctions/suicide_no_call.sol b/test/libsolidity/syntaxTests/globalFunctions/suicide_no_call.sol new file mode 100644 index 00000000..bf3f5ebc --- /dev/null +++ b/test/libsolidity/syntaxTests/globalFunctions/suicide_no_call.sol @@ -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" diff --git a/test/libsolidity/syntaxTests/globalFunctions/suicide_override.sol b/test/libsolidity/syntaxTests/globalFunctions/suicide_override.sol new file mode 100644 index 00000000..7350da39 --- /dev/null +++ b/test/libsolidity/syntaxTests/globalFunctions/suicide_override.sol @@ -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. diff --git a/test/libsolidity/syntaxTests/globalFunctions/suicide_var.sol b/test/libsolidity/syntaxTests/globalFunctions/suicide_var.sol new file mode 100644 index 00000000..3549a563 --- /dev/null +++ b/test/libsolidity/syntaxTests/globalFunctions/suicide_var.sol @@ -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. |