Restrict unary negation to signed integers.

This commit is contained in:
chriseth
2020-09-17 15:01:53 +02:00
parent e4231b879b
commit aa7a6922e7
6 changed files with 20 additions and 8 deletions
@@ -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