aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorYoichi Hirai <i@yoichihirai.com>2016-11-11 19:02:32 +0800
committerchriseth <c@ethdev.com>2016-11-16 21:37:18 +0800
commitf3d0433ec3aca99f6d9212da944c6fc51cb9292a (patch)
treedd525a0d663113225b5ca1e64f6e7b9b12d75865 /test
parente51f852504556f952ae1350c070409e3c4981cc0 (diff)
downloaddexon-solidity-f3d0433ec3aca99f6d9212da944c6fc51cb9292a.tar.gz
dexon-solidity-f3d0433ec3aca99f6d9212da944c6fc51cb9292a.tar.zst
dexon-solidity-f3d0433ec3aca99f6d9212da944c6fc51cb9292a.zip
test: add a test about external function type taking/returning internal functions
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 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"(