aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoichi Hirai <i@yoichihirai.com>2016-10-25 00:40:22 +0800
committerYoichi Hirai <i@yoichihirai.com>2016-10-25 22:48:26 +0800
commit578b02bb37bf7cc2fa8cdcb745eaeef5591ea27e (patch)
tree6732c3ed15ca0d391a627d7f97da2eddbd516189
parent4f1b5d26f7942117b44f199b0e73ce648b90bafb (diff)
downloaddexon-solidity-578b02bb37bf7cc2fa8cdcb745eaeef5591ea27e.tar.gz
dexon-solidity-578b02bb37bf7cc2fa8cdcb745eaeef5591ea27e.tar.zst
dexon-solidity-578b02bb37bf7cc2fa8cdcb745eaeef5591ea27e.zip
Add tests for #1246
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp16
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"(