mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
21 lines
378 B
Solidity
21 lines
378 B
Solidity
contract C {
|
|
modifier revertIfNoReturn() {
|
|
_;
|
|
revert();
|
|
}
|
|
modifier ifFlag(bool flag) {
|
|
if (flag)
|
|
_;
|
|
}
|
|
struct S { uint a; }
|
|
S s;
|
|
function f(bool flag) revertIfNoReturn() internal view {
|
|
if (flag) s;
|
|
}
|
|
function g(bool flag) revertIfNoReturn() ifFlag(flag) internal view {
|
|
s;
|
|
}
|
|
|
|
}
|
|
// ----
|