aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2017-03-01 22:53:24 +0800
committerchriseth <c@ethdev.com>2017-03-01 22:53:24 +0800
commitf35b70f3a325f7dd31eb51b0cff3eaf993bfffbb (patch)
treed02882759926e933a56ab8dc8b383e512b6f8dec /test/libsolidity
parentd2c79bf8e9400f783bf0feed34065882eae02a68 (diff)
downloaddexon-solidity-f35b70f3a325f7dd31eb51b0cff3eaf993bfffbb.tar.gz
dexon-solidity-f35b70f3a325f7dd31eb51b0cff3eaf993bfffbb.tar.zst
dexon-solidity-f35b70f3a325f7dd31eb51b0cff3eaf993bfffbb.zip
Test case for external function type with calldata argument.
Diffstat (limited to 'test/libsolidity')
-rw-r--r--test/libsolidity/SolidityNameAndTypeResolution.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp
index bb274614..866bd9aa 100644
--- a/test/libsolidity/SolidityNameAndTypeResolution.cpp
+++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp
@@ -4736,6 +4736,23 @@ BOOST_AUTO_TEST_CASE(delete_external_function_type_invalid)
CHECK_ERROR(text, TypeError, "");
}
+BOOST_AUTO_TEST_CASE(external_function_to_function_type_calldata_parameter)
+{
+ // This is a test that checks that the type of the `bytes` parameter is
+ // correctly changed from its own type `bytes calldata` to `bytes memory`
+ // when converting to a function type.
+ char const* text = R"(
+ contract C {
+ function f(function(bytes memory x) external g) { }
+ function callback(bytes x) external {}
+ function g() {
+ f(this.callback);
+ }
+ }
+ )";
+ CHECK_SUCCESS(text);
+}
+
BOOST_AUTO_TEST_CASE(external_function_type_to_address)
{
char const* text = R"(