solidity/test/libsolidity/smtCheckerTests/operators/conditional_assignment_always_true.sol

13 lines
351 B
Solidity
Raw Normal View History

pragma experimental SMTChecker;
contract C {
function f(bool b) public pure {
require(b);
uint c = b ? 5 : 1;
assert(c < 5);
}
}
// ----
2021-01-06 15:06:15 +00:00
// Warning 6328: (118-131): CHC: Assertion violation happens here.\nCounterexample:\n\nb = true\n\nTransaction trace:\nC.constructor()\nC.f(true)
// Warning 6838: (105-106): BMC: Condition is always true.