Warn deprecated usage of parameter names in function types

This commit is contained in:
Federico Bond
2017-06-26 15:39:01 -03:00
parent bffb8c404f
commit 70fd5c1770
4 changed files with 36 additions and 2 deletions
@@ -5022,6 +5022,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"(