Skip to content

Commit

Permalink
fix: disable uadd operator (#3174)
Browse files Browse the repository at this point in the history
it should have been disabled, but there was some code which was never
removed which bypassed the check.
  • Loading branch information
charles-cooper authored Dec 7, 2022
1 parent 1a568bf commit e60b021
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 5 additions & 0 deletions tests/parser/exceptions/test_syntax_exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ def foo():
"""
a: internal(uint256)
""",
"""
@external
def foo():
x: uint256 = +1 # test UAdd ast blocked
""",
]


Expand Down
5 changes: 0 additions & 5 deletions vyper/ast/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,6 @@ def visit_UnaryOp(self, node):
"""
self.generic_visit(node)

# TODO once grammar is updated, remove this
# UAdd has no effect on the value of it's operand, so it is discarded
if isinstance(node.op, python_ast.UAdd):
return node.operand

is_sub = isinstance(node.op, python_ast.USub)
is_num = (
hasattr(node.operand, "n")
Expand Down

0 comments on commit e60b021

Please sign in to comment.