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

21 lines
296 B
Solidity
Raw Normal View History

contract C {
uint256 public x;
modifier run() {
for (uint256 i = 0; i < 10; i++) {
_;
break;
}
}
function f() public run {
uint256 k = x;
uint256 t = k + 1;
x = t;
}
}
// ----
// x() -> 0
// f() ->
// x() -> 1