diff options
author | Yoichi Hirai <i@yoichihirai.com> | 2016-11-11 19:02:32 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-11-16 21:37:18 +0800 |
commit | f3d0433ec3aca99f6d9212da944c6fc51cb9292a (patch) | |
tree | dd525a0d663113225b5ca1e64f6e7b9b12d75865 | |
parent | e51f852504556f952ae1350c070409e3c4981cc0 (diff) | |
download | dexon-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
-rw-r--r-- | test/libsolidity/SolidityNameAndTypeResolution.cpp | 20 |
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"( |