solidity/test/libsolidity/smtCheckerTests/typecast/cast_smaller_2.sol
2019-01-16 13:00:54 +01:00

15 lines
397 B
Solidity

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);
}
}
// ----
// Warning: (112-121): Type conversion is not yet fully supported and might yield false positives.
// Warning: (208-227): Assertion violation happens here