Bool variables should not allow arithmetic comparison

This commit is contained in:
Leonardo Alt
2018-04-27 11:35:58 +02:00
parent ef2111a2fe
commit ab251c7e7d
3 changed files with 2 additions and 35 deletions
-29
View File
@@ -388,35 +388,6 @@ BOOST_AUTO_TEST_CASE(bool_simple)
}
)";
CHECK_SUCCESS_NO_WARNINGS(text);
text = R"(
contract C {
function f(bool x) public pure {
bool y;
assert(x <= y);
}
}
)";
CHECK_WARNING(text, "Assertion violation happens here");
text = R"(
contract C {
function f(bool x) public pure {
bool y;
assert(x >= y);
}
}
)";
CHECK_SUCCESS_NO_WARNINGS(text);
text = R"(
contract C {
function f(bool x) public pure {
require(x);
bool y;
assert(x > y);
assert(y < x);
}
}
)";
CHECK_SUCCESS_NO_WARNINGS(text);
}
BOOST_AUTO_TEST_CASE(bool_int_mixed)