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

18 lines
292 B
Solidity
Raw Normal View History

2020-03-12 16:32:10 +00:00
contract C {
function() internal view returns(uint256) immutable z;
2020-06-23 12:14:24 +00:00
constructor() {
2020-03-12 16:32:10 +00:00
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