solidity/test/libsolidity/semanticTests/modifiers/function_modifier_library.sol

31 lines
416 B
Solidity
Raw Normal View History

library L {
struct S {
uint256 v;
}
modifier mod(S storage s) {
s.v++;
_;
}
function libFun(S storage s) internal mod(s) {
s.v += 0x100;
}
}
contract Test {
using L for *;
L.S s;
function f() public returns (uint256) {
s.libFun();
L.libFun(s);
return s.v;
}
}
2020-11-30 17:59:49 +00:00
// ====
// compileViaYul: also
// ----
// f() -> 0x202