Skip to content

Commit

Permalink
bug[next]: fix _Dedup for tuples in type_inference (#1495)
Browse files Browse the repository at this point in the history
  • Loading branch information
havogt authored Mar 15, 2024
1 parent 424dfe2 commit ee17241
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/gt4py/next/type_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,10 @@ def _free_variables(x: Type) -> set[TypeVar]:
class _Dedup(eve.NodeTranslator):
"""Deduplicate type nodes that have the same value but a different `id`."""

def visit(self, node, *, memo: dict[T, T]) -> typing.Any: # type: ignore[override]
def visit(self, node: Type | typing.Sequence[Type], *, memo: dict[Type, Type]) -> typing.Any: # type: ignore[override]
if isinstance(node, Type):
node = super().visit(node, memo=memo)
return memo.setdefault(node, node)
return node
return self.generic_visit(node, memo=memo)


def _assert_constituent_types(value: typing.Any, allowed_types: tuple[type, ...]) -> None:
Expand Down

0 comments on commit ee17241

Please sign in to comment.