Skip to content

Commit

Permalink
Catch empty operands operation in collapse_constants.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rihi committed Oct 16, 2023
1 parent cc44b6d commit 83252d9
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class CollapseConstants(SimplificationRule):
"""

def apply(self, operation: Operation) -> list[tuple[Expression, Expression]]:
if not operation.operands:
return [] # Is this even allowed?
if not all(isinstance(o, Constant) for o in operation.operands):
return []

Expand Down

0 comments on commit 83252d9

Please sign in to comment.