mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
19 lines
490 B
Solidity
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
|