From 70fd5c17704119a3f52aba5c67eda96c2a222d2d Mon Sep 17 00:00:00 2001 From: Federico Bond Date: Sat, 24 Jun 2017 14:09:19 -0300 Subject: Warn deprecated usage of parameter names in function types --- test/libsolidity/SolidityNameAndTypeResolution.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'test/libsolidity') diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index c4b1250f..a1428972 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -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"( -- cgit