Merge pull request #2464 from federicobond/deprecate-function-type-names

Warn deprecated usage of parameter names in function types
This commit is contained in:
chriseth
2017-06-27 16:32:48 +02:00
committed by GitHub
4 changed files with 36 additions and 2 deletions
@@ -5129,6 +5129,26 @@ BOOST_AUTO_TEST_CASE(external_function_type_to_uint)
CHECK_ERROR(text, TypeError, "Explicit type conversion not allowed");
}
BOOST_AUTO_TEST_CASE(warn_function_type_parameters_with_names)
{
char const* text = R"(
contract C {
function(uint a) f;
}
)";
CHECK_WARNING(text, "Naming function type parameters is deprecated.");
}
BOOST_AUTO_TEST_CASE(warn_function_type_return_parameters_with_names)
{
char const* text = R"(
contract C {
function(uint) returns(bool ret) f;
}
)";
CHECK_WARNING(text, "Naming function type return parameters is deprecated.");
}
BOOST_AUTO_TEST_CASE(shift_constant_left_negative_rvalue)
{
char const* text = R"(