diff --git a/crates/integration/contracts/FunctionType.sol b/crates/integration/contracts/FunctionType.sol new file mode 100644 index 0000000..f95d200 --- /dev/null +++ b/crates/integration/contracts/FunctionType.sol @@ -0,0 +1,36 @@ +// SPDX-License-Identifier: MIT + +pragma solidity ^0.8.28; + +/* runner.json +{ + "differential": true, + "actions": [ + { + "Instantiate": { + "code": { + "Solidity": { + "contract": "FunctionType" + } + } + } + }, + { + "Call": { + "dest": { + "Instantiated": 0 + }, + "data": "b8c9d365" + } + } + ] +} +*/ + +contract FunctionType { + uint public immutable x = 42; + + function h() public view returns (function() external view returns (uint)) { + return this.x; + } +} diff --git a/crates/integration/src/tests.rs b/crates/integration/src/tests.rs index 3b1cac9..def9625 100644 --- a/crates/integration/src/tests.rs +++ b/crates/integration/src/tests.rs @@ -56,6 +56,7 @@ test_spec!(transfer, "Transfer", "Transfer.sol"); test_spec!(send, "Send", "Send.sol"); test_spec!(function_pointer, "FunctionPointer", "FunctionPointer.sol"); test_spec!(mload, "MLoad", "MLoad.sol"); +test_spec!(function_type, "FunctionType", "FunctionType.sol"); fn instantiate(path: &str, contract: &str) -> Vec { vec![Instantiate {