diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-10-04 17:59:21 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-10-20 18:59:18 +0800 |
commit | 3a8324266f470b18763054ed5caa791e8e8410a7 (patch) | |
tree | 1246f7a431a8e380d0348ba239e0a412fd69182f /test/libsolidity | |
parent | 4e7d1440ab84ba0566c7c75ff61b2f9e70738ef4 (diff) | |
download | dexon-solidity-3a8324266f470b18763054ed5caa791e8e8410a7.tar dexon-solidity-3a8324266f470b18763054ed5caa791e8e8410a7.tar.gz dexon-solidity-3a8324266f470b18763054ed5caa791e8e8410a7.tar.bz2 dexon-solidity-3a8324266f470b18763054ed5caa791e8e8410a7.tar.lz dexon-solidity-3a8324266f470b18763054ed5caa791e8e8410a7.tar.xz dexon-solidity-3a8324266f470b18763054ed5caa791e8e8410a7.tar.zst dexon-solidity-3a8324266f470b18763054ed5caa791e8e8410a7.zip |
More detailed errors for invalid array lengths (such as division by zero).
Diffstat (limited to 'test/libsolidity')
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 9b5ea349..e5990e9b 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -7247,6 +7247,12 @@ BOOST_AUTO_TEST_CASE(array_length_invalid_expression) } )"; CHECK_ERROR(text, TypeError, "Invalid literal value."); + text = R"( + contract C { + uint[3/0] ids; + } + )"; + CHECK_ERROR(text, TypeError, "Operator / not compatible with types int_const 3 and int_const 0"); } BOOST_AUTO_TEST_CASE(no_address_members_on_contract) |