diff options
author | chriseth <chris@ethereum.org> | 2016-10-26 20:28:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-26 20:28:10 +0800 |
commit | 34e2209bcc782ceb0400b73cda23bf1173ea34e9 (patch) | |
tree | 33d044a39ec84cd20c505b62c0d440ad78ee6617 /test/libsolidity | |
parent | 4f1b5d26f7942117b44f199b0e73ce648b90bafb (diff) | |
parent | 3ca5900b8c0b69d640ef46388b0d2250275356fc (diff) | |
download | dexon-solidity-34e2209bcc782ceb0400b73cda23bf1173ea34e9.tar dexon-solidity-34e2209bcc782ceb0400b73cda23bf1173ea34e9.tar.gz dexon-solidity-34e2209bcc782ceb0400b73cda23bf1173ea34e9.tar.bz2 dexon-solidity-34e2209bcc782ceb0400b73cda23bf1173ea34e9.tar.lz dexon-solidity-34e2209bcc782ceb0400b73cda23bf1173ea34e9.tar.xz dexon-solidity-34e2209bcc782ceb0400b73cda23bf1173ea34e9.tar.zst dexon-solidity-34e2209bcc782ceb0400b73cda23bf1173ea34e9.zip |
Merge pull request #1274 from ethereum/signed-exp
Banning signed exp
Diffstat (limited to 'test/libsolidity')
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 9fe91cca..640cc108 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -2098,6 +2098,22 @@ BOOST_AUTO_TEST_CASE(integer_boolean_operators) BOOST_CHECK(expectError(sourceCode3) == Error::Type::TypeError); } +BOOST_AUTO_TEST_CASE(exp_signed_variable) +{ + char const* sourceCode1 = R"( + contract test { function() { uint x = 3; int y = -4; x ** y; } } + )"; + BOOST_CHECK(expectError(sourceCode1) == Error::Type::TypeError); + char const* sourceCode2 = R"( + contract test { function() { uint x = 3; int y = -4; y ** x; } } + )"; + BOOST_CHECK(expectError(sourceCode2) == Error::Type::TypeError); + char const* sourceCode3 = R"( + contract test { function() { int x = -3; int y = -4; x ** y; } } + )"; + BOOST_CHECK(expectError(sourceCode3) == Error::Type::TypeError); +} + BOOST_AUTO_TEST_CASE(reference_compare_operators) { char const* sourceCode1 = R"( |