aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorFederico Bond <federicobond@gmail.com>2017-06-25 01:09:19 +0800
committerFederico Bond <federicobond@gmail.com>2017-06-27 02:39:01 +0800
commit70fd5c17704119a3f52aba5c67eda96c2a222d2d (patch)
tree2cc6c9255c71f821bed14ed5b2b37ccf1162bbe5 /test
parentbffb8c404f0df22c4da7cdc2a8affcbb77377582 (diff)
downloaddexon-solidity-70fd5c17704119a3f52aba5c67eda96c2a222d2d.tar
dexon-solidity-70fd5c17704119a3f52aba5c67eda96c2a222d2d.tar.gz
dexon-solidity-70fd5c17704119a3f52aba5c67eda96c2a222d2d.tar.bz2
dexon-solidity-70fd5c17704119a3f52aba5c67eda96c2a222d2d.tar.lz
dexon-solidity-70fd5c17704119a3f52aba5c67eda96c2a222d2d.tar.xz
dexon-solidity-70fd5c17704119a3f52aba5c67eda96c2a222d2d.tar.zst
dexon-solidity-70fd5c17704119a3f52aba5c67eda96c2a222d2d.zip
Warn deprecated usage of parameter names in function types
Diffstat (limited to 'test')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp20
1 files changed, 20 insertions, 0 deletions
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"(