solidity/test/libsolidity/smtCheckerTests/typecast/cast_smaller_2.sol

15 lines
407 B
Solidity
Raw Normal View History

2018-12-20 12:20:07 +00:00
pragma experimental SMTChecker;
contract C
{
function f() public pure {
uint32 a = 0x12345678;
uint16 b = uint16(a); // b will be 0x5678 now
// False positive since truncation is not supported yet.
assert(b == 0x5678);
}
}
// ----
2020-07-13 18:48:00 +00:00
// Warning 6328: (208-227): Assertion violation happens here
// Warning 5084: (112-121): Type conversion is not yet fully supported and might yield false positives.