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

22 lines
354 B
Solidity
Raw Normal View History

2020-03-12 16:32:10 +00:00
contract C {
uint256 immutable x;
uint256 immutable y;
mapping(uint => uint) public m;
constructor(uint _a) public {
x = 42;
y = 23;
m[_a] = 7;
new uint[](4);
}
function f() public view returns (uint256, uint256) {
return (x+x,y);
}
}
2020-04-02 18:06:52 +00:00
// ====
// compileViaYul: also
2020-03-12 16:32:10 +00:00
// ----
// constructor(): 3 ->
// f() -> 84, 23
// m(uint256): 3 -> 7