From f3d0433ec3aca99f6d9212da944c6fc51cb9292a Mon Sep 17 00:00:00 2001 From: Yoichi Hirai Date: Fri, 11 Nov 2016 12:02:32 +0100 Subject: test: add a test about external function type taking/returning internal functions --- 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 5916ed10..865eb7ce 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -4215,6 +4215,26 @@ BOOST_AUTO_TEST_CASE(call_value_on_non_payable_function_type) BOOST_CHECK(expectError(text) == Error::Type::TypeError); } +BOOST_AUTO_TEST_CASE(external_function_type_returning_internal) +{ + char const* text = R"( + contract C { + function() external returns (function () internal) x; + } + )"; + BOOST_CHECK(expectError(text) == Error::Type::TypeError); +} + +BOOST_AUTO_TEST_CASE(external_function_type_taking_internal) +{ + char const* text = R"( + contract C { + function(function () internal) external x; + } + )"; + BOOST_CHECK(expectError(text) == Error::Type::TypeError); +} + BOOST_AUTO_TEST_CASE(call_value_on_payable_function_type) { char const* text = R"( -- cgit