Test for calling external library functions with mapping parameters (does not work via Yul yet)

This commit is contained in:
Kamil Śliwak 2020-11-09 01:32:17 +01:00
parent dfa0a0cdff
commit ced140615a

View File

@ -0,0 +1,17 @@
library L {
function f(mapping(uint256 => uint256) storage _a) external returns (uint256) {
return _a[0] * _a[1];
}
}
contract C {
mapping(uint256 => uint256) x;
function g(uint256 _value) external returns (uint256) {
x[0] = x[1] = _value;
return L.f(x);
}
}
// ----
// library: L
// g(uint256): 4 -> 16