diff options
author | CJentzsch <jentzsch.software@gmail.com> | 2015-08-11 15:08:45 +0800 |
---|---|---|
committer | CJentzsch <jentzsch.software@gmail.com> | 2015-08-11 15:08:45 +0800 |
commit | 211721a542f02691ef615401d9460383991a5f37 (patch) | |
tree | 74d2d0445bf5a49331f12659b8fa19ba41c429df | |
parent | df39c9962926c2950d0b7ac10e3c9a4189bf2d55 (diff) | |
parent | 4907bda371804b152c7af71a1ba818cda5da60c4 (diff) | |
download | dexon-solidity-211721a542f02691ef615401d9460383991a5f37.tar dexon-solidity-211721a542f02691ef615401d9460383991a5f37.tar.gz dexon-solidity-211721a542f02691ef615401d9460383991a5f37.tar.bz2 dexon-solidity-211721a542f02691ef615401d9460383991a5f37.tar.lz dexon-solidity-211721a542f02691ef615401d9460383991a5f37.tar.xz dexon-solidity-211721a542f02691ef615401d9460383991a5f37.tar.zst dexon-solidity-211721a542f02691ef615401d9460383991a5f37.zip |
Merge remote-tracking branch 'upstream/develop' into fixStateTestsFilling
-rw-r--r-- | libsolidity/SolidityNameAndTypeResolution.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/libsolidity/SolidityNameAndTypeResolution.cpp b/libsolidity/SolidityNameAndTypeResolution.cpp index 6b116f25..3daabc85 100644 --- a/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/libsolidity/SolidityNameAndTypeResolution.cpp @@ -1883,6 +1883,34 @@ BOOST_AUTO_TEST_CASE(positive_integers_to_unsigned_out_of_bound) BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode), TypeError); } +BOOST_AUTO_TEST_CASE(integer_boolean_operators) +{ + char const* sourceCode1 = R"( + contract test { function() { uint x = 1; uint y = 2; x || y; } } + )"; + BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode1), TypeError); + char const* sourceCode2 = R"( + contract test { function() { uint x = 1; uint y = 2; x && y; } } + )"; + BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode2), TypeError); + char const* sourceCode3 = R"( + contract test { function() { uint x = 1; !x; } } + )"; + BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode3), TypeError); +} + +BOOST_AUTO_TEST_CASE(reference_compare_operators) +{ + char const* sourceCode1 = R"( + contract test { bytes a; bytes b; function() { a == b; } } + )"; + BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode1), TypeError); + char const* sourceCode2 = R"( + contract test { struct s {uint a;} s x; s y; function() { x == y; } } + )"; + BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode2), TypeError); +} + BOOST_AUTO_TEST_CASE(overwrite_memory_location_external) { char const* sourceCode = R"( |