solidity/test/libsolidity/semanticTests/immutable/internal_function_pointer.sol

18 lines
299 B
Solidity
Raw Normal View History

2020-03-12 16:32:10 +00:00
contract C {
function() internal view returns(uint256) immutable z;
constructor() public {
z = f;
}
function f() public view returns (uint256) {
return 7;
}
function callZ() public view returns (uint) {
return z();
}
}
2020-04-02 18:06:52 +00:00
// ====
// compileViaYul: also
2020-03-12 16:32:10 +00:00
// ----
// f() -> 7
// callZ() -> 7