mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
21 lines
476 B
Solidity
21 lines
476 B
Solidity
function uncheckedSuffix(uint8 x) pure suffix returns (uint8) {
|
|
unchecked {
|
|
return x + 10;
|
|
}
|
|
}
|
|
|
|
contract C {
|
|
function testUncheckedSuffix() public pure returns (uint8) {
|
|
return 250 uncheckedSuffix;
|
|
}
|
|
|
|
function testUncheckedSuffixInUncheckedBlock() public pure returns (uint8) {
|
|
unchecked {
|
|
return 250 uncheckedSuffix;
|
|
}
|
|
}
|
|
}
|
|
// ----
|
|
// testUncheckedSuffix() -> 4
|
|
// testUncheckedSuffixInUncheckedBlock() -> 4
|