solidity/test/libsolidity/semanticTests/literalSuffixes/checked_suffixes.sol
2023-05-17 16:55:14 +02:00

19 lines
490 B
Solidity

function checkedSuffix(uint8 x) pure suffix returns (uint8) {
return x + 10;
}
contract C {
function testCheckedSuffix() public pure returns (uint8) {
return 250 checkedSuffix;
}
function testCheckedSuffixInUncheckedBlock() public pure returns (uint8) {
unchecked {
return 250 checkedSuffix;
}
}
}
// ----
// testCheckedSuffix() -> FAILURE, hex"4e487b71", 0x11
// testCheckedSuffixInUncheckedBlock() -> FAILURE, hex"4e487b71", 0x11