solidity/test/libsolidity/smtCheckerTests/try_catch/try_nested_2.sol
2022-05-04 19:04:54 +02:00

25 lines
506 B
Solidity

contract C {
function g() public pure returns (uint, uint) {
}
function f() public view {
uint choice = 42;
try this.g() returns (uint, uint) {
choice = 10;
try this.g() returns (uint, uint) {
choice = 1;
} catch {
choice = 2;
}
} catch {
choice = 3;
}
assert(choice >= 1 && choice <= 3); // should hold
assert(choice == 42); // should fail
}
}
// ====
// SMTEngine: all
// SMTIgnoreCex: yes
// ----
// Warning 6328: (342-362): CHC: Assertion violation happens here.