solidity/test/libsolidity/semanticTests/inheritance/inherited_function_calldata_calldata_interface.sol
Djordje Mijovic b73e9f3eef Update tests.
2021-03-10 14:22:30 +01:00

30 lines
526 B
Solidity

interface I {
function f(uint256[] calldata a) external returns (uint256);
}
contract A is I {
function f(uint256[] calldata a) external override returns (uint256) {
return 42;
}
}
contract B {
function f(uint256[] memory a) public returns (uint256) {
return a[1];
}
function g() public returns (uint256) {
I i = I(new A());
return i.f(new uint256[](2));
}
}
// ====
// compileViaYul: also
// ----
// g() -> 42
// gas irOptimized: 107179
// gas legacy: 117797