Merge pull request #14139 from ethereum/make-plus-binary-only

Make plus binary only (second attempt)
This commit is contained in:
Daniel
2023-04-18 21:20:31 +02:00
committed by GitHub
11 changed files with 29 additions and 24 deletions
@@ -0,0 +1,9 @@
contract C
{
function f() public
{
int x = +(0, 0);
}
}
// ----
// ParserError 9636: (59-60): Use of unary + is disallowed.
@@ -2,19 +2,15 @@ contract C
{
function f() public
{
int x = +(0, 0);
int y = -(0, 0);
(int z) = ~(0, 0);
(int t) = !(0, 0);
}
}
// ----
// SyntaxError 9636: (59-66): Use of unary + is disallowed.
// TypeError 4907: (59-66): Built-in unary operator + cannot be applied to type tuple(int_const 0,int_const 0).
// TypeError 4907: (59-66): Built-in unary operator - cannot be applied to type tuple(int_const 0,int_const 0).
// TypeError 7364: (51-66): Different number of components on the left hand side (1) than on the right hand side (2).
// TypeError 4907: (84-91): Built-in unary operator - cannot be applied to type tuple(int_const 0,int_const 0).
// TypeError 7364: (76-91): Different number of components on the left hand side (1) than on the right hand side (2).
// TypeError 4907: (111-118): Built-in unary operator ~ cannot be applied to type tuple(int_const 0,int_const 0).
// TypeError 7364: (101-118): Different number of components on the left hand side (1) than on the right hand side (2).
// TypeError 4907: (138-145): Built-in unary operator ! cannot be applied to type tuple(int_const 0,int_const 0).
// TypeError 7364: (128-145): Different number of components on the left hand side (1) than on the right hand side (2).
// TypeError 4907: (86-93): Built-in unary operator ~ cannot be applied to type tuple(int_const 0,int_const 0).
// TypeError 7364: (76-93): Different number of components on the left hand side (1) than on the right hand side (2).
// TypeError 4907: (113-120): Built-in unary operator ! cannot be applied to type tuple(int_const 0,int_const 0).
// TypeError 7364: (103-120): Different number of components on the left hand side (1) than on the right hand side (2).
@@ -6,5 +6,4 @@ contract test {
}
}
// ----
// SyntaxError 9636: (70-75): Use of unary + is disallowed.
// TypeError 4907: (70-75): Built-in unary operator + cannot be applied to type rational_const 13 / 4.
// ParserError 9636: (70-71): Use of unary + is disallowed.
@@ -5,5 +5,4 @@ contract test {
}
}
// ----
// SyntaxError 9636: (70-72): Use of unary + is disallowed.
// TypeError 4907: (70-72): Built-in unary operator + cannot be applied to type uint256.
// ParserError 9636: (70-71): Use of unary + is disallowed.