diff options
author | chriseth <chris@ethereum.org> | 2017-06-30 22:37:08 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2017-06-30 22:37:32 +0800 |
commit | 044058276ea27b3d43622b28416ad4dc41091a31 (patch) | |
tree | 9117848d13230d9db2378fa2e9f659ce0d0942db /test/libsolidity | |
parent | 735c977db1824436d09d8e7a5c120fcab21003c3 (diff) | |
download | dexon-solidity-044058276ea27b3d43622b28416ad4dc41091a31.tar dexon-solidity-044058276ea27b3d43622b28416ad4dc41091a31.tar.gz dexon-solidity-044058276ea27b3d43622b28416ad4dc41091a31.tar.bz2 dexon-solidity-044058276ea27b3d43622b28416ad4dc41091a31.tar.lz dexon-solidity-044058276ea27b3d43622b28416ad4dc41091a31.tar.xz dexon-solidity-044058276ea27b3d43622b28416ad4dc41091a31.tar.zst dexon-solidity-044058276ea27b3d43622b28416ad4dc41091a31.zip |
Warn about callcode.
Diffstat (limited to 'test/libsolidity')
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 169b33d1..d0aee3d0 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -4679,7 +4679,7 @@ BOOST_AUTO_TEST_CASE(unused_return_value_callcode) } } )"; - CHECK_WARNING(text, "Return value of low-level calls not used"); + CHECK_WARNING_ALLOW_MULTI(text, "Return value of low-level calls not used"); } BOOST_AUTO_TEST_CASE(unused_return_value_delegatecall) @@ -4694,6 +4694,31 @@ BOOST_AUTO_TEST_CASE(unused_return_value_delegatecall) CHECK_WARNING(text, "Return value of low-level calls not used"); } +BOOST_AUTO_TEST_CASE(warn_about_callcode) +{ + char const* text = R"( + contract test { + function f() { + var x = address(0x12).callcode; + x; + } + } + )"; + CHECK_WARNING(text, "\"callcode\" has been deprecated in favour"); +} + +BOOST_AUTO_TEST_CASE(no_warn_about_callcode_as_local) +{ + char const* text = R"( + contract test { + function callcode() { + var x = this.callcode; + } + } + )"; + CHECK_SUCCESS_NO_WARNINGS(text); +} + BOOST_AUTO_TEST_CASE(modifier_without_underscore) { char const* text = R"( |