solidity/test/libsolidity/smtCheckerTests/control_flow/short_circuit_and_touched.sol

20 lines
512 B
Solidity
Raw Normal View History

2019-05-03 04:15:00 +00:00
pragma experimental SMTChecker;
contract C
{
bool b;
function f() public {
if ((b = false) && (b == true)) {}
if ((b == false) && (b = true)) {}
if ((b = false) && (b = true)) {}
if ((b == false) && (b == true)) {}
if ((b = true) && b) {}
}
}
// ----
// Warning: (84-110): Condition is always false.
// Warning: (121-147): Condition is always true.
// Warning: (158-183): Condition is always false.
// Warning: (194-221): Condition is always false.
// Warning: (232-247): Condition is always true.