solidity/test/libsolidity/syntaxTests/negation.sol
2022-04-04 16:53:36 +05:30

10 lines
249 B
Solidity

contract test {
function f() public pure {
int x;
uint y = uint(-x);
-y;
}
}
// ----
// TypeError 4907: (97-99): Unary operator - cannot be applied to type uint256. Unary negation is only allowed for signed integers.