2020-03-09 21:14:07 +00:00
|
|
|
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));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-09 19:59:17 +00:00
|
|
|
// ====
|
|
|
|
// compileViaYul: also
|
2020-03-09 21:14:07 +00:00
|
|
|
// ----
|
|
|
|
// g() -> 42
|
2021-03-19 13:25:19 +00:00
|
|
|
// gas irOptimized: 102803
|
2021-02-12 12:45:15 +00:00
|
|
|
// gas legacy: 117797
|