solidity/test/libsolidity/semanticTests/freeFunctions/storage_calldata_refs.sol
2020-08-18 11:46:59 +02:00

18 lines
428 B
Solidity

contract C {
uint[] data;
function f(uint x, uint[] calldata input) public returns (uint, uint) {
data.push(x);
(uint a, uint[] calldata b) = fun(input, data);
return (a, b[1]);
}
}
function fun(uint[] calldata _x, uint[] storage _y) view returns (uint, uint[] calldata) {
return (_y[0], _x);
}
// ====
// compileViaYul: also
// ----
// f(uint256,uint256[]): 7, 0x40, 3, 8, 9, 10 -> 7, 9