diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-02-27 09:10:24 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-02-27 09:10:24 +0800 |
commit | 5c0d82059f50cb6ac67171ca075f394acae27228 (patch) | |
tree | c0a81bfc65d3a991ddced5a954a5c6a63b6f39f3 /test/libsolidity | |
parent | 1f5eb4ba59891387c2dfcc10103c2f187bf2b4ee (diff) | |
download | dexon-solidity-5c0d82059f50cb6ac67171ca075f394acae27228.tar.gz dexon-solidity-5c0d82059f50cb6ac67171ca075f394acae27228.tar.zst dexon-solidity-5c0d82059f50cb6ac67171ca075f394acae27228.zip |
Turn throw into a syntax error for 0.5.0
Diffstat (limited to 'test/libsolidity')
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 93abee0d..be147e48 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -6332,7 +6332,16 @@ BOOST_AUTO_TEST_CASE(warn_about_throw) } } )"; - CHECK_WARNING(text, "\"throw\" is deprecated"); + CHECK_WARNING(text, "\"throw\" is deprecated in favour of \"revert()\", \"require()\" and \"assert()\""); + text = R"( + pragma experimental "v0.5.0"; + contract C { + function f() pure public { + throw; + } + } + )"; + CHECK_ERROR(text, SyntaxError, "\"throw\" is deprecated in favour of \"revert()\", \"require()\" and \"assert()\""); } BOOST_AUTO_TEST_CASE(bare_revert) |