solidity/test/libsolidity/syntaxTests/controlFlow/localStorageVariables/modifier_declaration_fine.sol

21 lines
366 B
Solidity
Raw Normal View History

contract C {
2021-12-30 17:16:29 +00:00
modifier alwaysRevert() {
_;
revert();
}
modifier ifFlag(bool flag) {
if (flag)
_;
}
struct S { uint a; }
S s;
2021-12-30 17:16:29 +00:00
function f(bool flag) alwaysRevert() internal view {
if (flag) s;
}
2021-12-30 17:16:29 +00:00
function g(bool flag) alwaysRevert() ifFlag(flag) internal view {
s;
}
}
// ----