mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Restrict unary negation to signed integers.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
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
|
||||
Reference in New Issue
Block a user