Style and stricter tests.

This commit is contained in:
chriseth 2017-05-02 15:48:58 +02:00
parent e544698ad3
commit 96870686a9
2 changed files with 10 additions and 4 deletions

View File

@ -161,9 +161,7 @@ bool SyntaxChecker::visit(Break const& _breakStatement)
bool SyntaxChecker::visit(UnaryOperation const& _operation) bool SyntaxChecker::visit(UnaryOperation const& _operation)
{ {
if (_operation.getOperator() == Token::Add) if (_operation.getOperator() == Token::Add)
{ warning(_operation.location(), "Use of unary + is deprecated.");
warning(_operation.location(), "Use of unary + is deprecated");
}
return true; return true;
} }

View File

@ -3943,7 +3943,7 @@ BOOST_AUTO_TEST_CASE(rational_unary_operation)
} }
} }
)"; )";
CHECK_SUCCESS(text); CHECK_SUCCESS_NO_WARNINGS(text);
text = R"( text = R"(
contract test { contract test {
function f() { function f() {
@ -3953,6 +3953,14 @@ BOOST_AUTO_TEST_CASE(rational_unary_operation)
} }
)"; )";
CHECK_WARNING(text,"Use of unary + is deprecated"); CHECK_WARNING(text,"Use of unary + is deprecated");
text = R"(
contract test {
function f(uint x) {
uint y = +x;
}
}
)";
CHECK_WARNING(text,"Use of unary + is deprecated");
} }
BOOST_AUTO_TEST_CASE(leading_zero_rationals_convert) BOOST_AUTO_TEST_CASE(leading_zero_rationals_convert)