solidity/test/libsolidity/syntaxTests/functionTypes/external_function_to_function_type_calldata_parameter.sol

11 lines
393 B
Solidity
Raw Normal View History

2018-03-16 10:33:05 +00:00
// 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.
2018-03-16 10:20:06 +00:00
contract C {
2018-03-16 10:33:05 +00:00
function f(function(bytes memory) pure external /*g*/) pure public { }
2018-08-07 17:12:49 +00:00
function callback(bytes calldata) pure external {}
2018-03-16 10:33:05 +00:00
function g() view public {
2018-03-16 10:20:06 +00:00
f(this.callback);
}
}