-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parser: Fix spuriously emitted parser error for unary plus operations…
… when used as binary operator in some cases
- Loading branch information
Showing
5 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...iceRegressionTests/declarationUnaryTuple/declaration_unary_plus_tuple_compound_assign.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
contract C | ||
{ | ||
function f(int x) public | ||
{ | ||
(x /= 1) + +(1,1); | ||
} | ||
} | ||
// ---- | ||
// ParserError 9636: (67-68): Use of unary + is disallowed. |
9 changes: 9 additions & 0 deletions
9
test/libsolidity/syntaxTests/nameAndTypeResolution/591_access_to_internal_variable.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
contract C { | ||
function f(int32 x) external pure returns (int32) | ||
{ | ||
this.x + 1; | ||
return x; | ||
} | ||
} | ||
// ---- | ||
// TypeError 9582: (81-87): Member "x" not found or not visible after argument-dependent lookup in contract C. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
contract C { | ||
function f(int32 x) external pure returns (int32) | ||
{ | ||
x = 1 + 1; | ||
(x /= 1) + 1; | ||
(x = ++x) + 1; | ||
(0) + 1; | ||
return x; | ||
} | ||
} | ||
// ---- | ||
// Warning 6133: (145-152): Statement has no effect. |