solidity/test/libsolidity/smtCheckerTests/try_catch/try_2.sol
Martin Blicha 09de54b5eb tests
2021-01-11 13:36:03 +01:00

20 lines
377 B
Solidity

pragma experimental SMTChecker;
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
}
}
}
// ----
// Warning 5667: (187-201): Unused try/catch parameter. Remove or comment out the variable name to silence this warning.