Skip to content

Commit

Permalink
Fix type synthesizer for partially typed arithmetic ops
Browse files Browse the repository at this point in the history
  • Loading branch information
tehrengruber committed Dec 1, 2024
1 parent 43f5741 commit 7b37f1c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/gt4py/next/iterator/type_system/type_synthesizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ def power(base: ts.ScalarType, exponent: ts.ScalarType) -> ts.ScalarType:

@_register_builtin_type_synthesizer(fun_names=itir.BINARY_MATH_NUMBER_BUILTINS)
def _(lhs: ts.ScalarType, rhs: ts.ScalarType) -> ts.ScalarType:
if isinstance(lhs, ts.DeferredType):
return rhs
if isinstance(rhs, ts.DeferredType):
return lhs
assert lhs == rhs
return lhs

Expand Down

0 comments on commit 7b37f1c

Please sign in to comment.