From 96870686a9aba46a14d659c8c1cd107a9071857f Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 2 May 2017 15:48:58 +0200 Subject: [PATCH] Style and stricter tests. --- libsolidity/analysis/SyntaxChecker.cpp | 4 +--- test/libsolidity/SolidityNameAndTypeResolution.cpp | 10 +++++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/libsolidity/analysis/SyntaxChecker.cpp b/libsolidity/analysis/SyntaxChecker.cpp index 308733df6..94e82a878 100644 --- a/libsolidity/analysis/SyntaxChecker.cpp +++ b/libsolidity/analysis/SyntaxChecker.cpp @@ -161,9 +161,7 @@ bool SyntaxChecker::visit(Break const& _breakStatement) bool SyntaxChecker::visit(UnaryOperation const& _operation) { if (_operation.getOperator() == Token::Add) - { - warning(_operation.location(), "Use of unary + is deprecated"); - } + warning(_operation.location(), "Use of unary + is deprecated."); return true; } diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 8e80e0061..90d0e728f 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -3943,7 +3943,7 @@ BOOST_AUTO_TEST_CASE(rational_unary_operation) } } )"; - CHECK_SUCCESS(text); + CHECK_SUCCESS_NO_WARNINGS(text); text = R"( contract test { function f() { @@ -3953,6 +3953,14 @@ BOOST_AUTO_TEST_CASE(rational_unary_operation) } )"; 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)