solidity/test/libsolidity/semanticTests/modifiers/function_modifier_multi_invocation.sol
2020-03-19 14:42:25 +01:00

15 lines
235 B
Solidity

contract C {
modifier repeat(bool twice) {
if (twice) _;
_;
}
function f(bool twice) public repeat(twice) returns (uint256 r) {
r += 1;
}
}
// ----
// f(bool): false -> 1
// f(bool): true -> 2