solidity/test/libsolidity/smtCheckerTests/try_catch/try_2.sol

21 lines
371 B
Solidity
Raw Normal View History

2021-01-06 14:55:26 +00:00
contract C {
int x;
function g() public {
x = 42;
}
function f() public {
x = 0;
try this.g() {
assert(x == 42); // should hold
} catch (bytes memory s) {
assert(x == 0); // should hold
}
}
}
2021-03-31 15:11:54 +00:00
// ====
// SMTEngine: all
2021-01-06 14:55:26 +00:00
// ----
2021-03-31 15:11:54 +00:00
// Warning 5667: (155-169): Unused try/catch parameter. Remove or comment out the variable name to silence this warning.