Skip to content

Commit

Permalink
Remove unused argument
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-koch committed Nov 11, 2024
1 parent ced00e1 commit e25c3e2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions guppylang/checker/linearity_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,10 @@ def visit_Expr(self, node: ast.Expr) -> None:
raise GuppyTypeError(f"Value with linear type `{ty}` is not used", node)

def visit_DesugaredListComp(self, node: DesugaredListComp) -> None:
self._check_comprehension(node, node.generators, node.elt)
self._check_comprehension(node.generators, node.elt)

def visit_DesugaredArrayComp(self, node: DesugaredArrayComp) -> None:
self._check_comprehension(node, [node.generator], node.elt)
self._check_comprehension([node.generator], node.elt)

def visit_CheckedNestedFunctionDef(self, node: CheckedNestedFunctionDef) -> None:
# Linearity of the nested function has already been checked. We just need to
Expand Down Expand Up @@ -360,7 +360,7 @@ def _check_assign_targets(self, targets: list[ast.expr]) -> None:
self.scope.assign(tgt_place)

def _check_comprehension(
self, node: ast.expr, gens: list[DesugaredGenerator], elt: ast.expr
self, gens: list[DesugaredGenerator], elt: ast.expr
) -> None:
"""Helper function to recursively check list comprehensions."""
if not gens:
Expand Down Expand Up @@ -406,7 +406,7 @@ def _check_comprehension(
self.visit(expr)

# Recursively check the remaining generators
self._check_comprehension(node, gens, elt)
self._check_comprehension(gens, elt)

# Check the iter finalizer so we record a final use of the iterator
self.visit(gen.iterend)
Expand Down

0 comments on commit e25c3e2

Please sign in to comment.