Skip to content

Commit

Permalink
fix return type for call stmts
Browse files Browse the repository at this point in the history
  • Loading branch information
tserg committed Nov 20, 2023
1 parent 4a2744f commit 8b537c4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vyper/semantics/analysis/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,16 +324,16 @@ def visit_Expr(self, node):
expr_info.validate_modification(node, self.func.mutability)

# NOTE: fetch_call_return validates call args.
return_value = fn_type.fetch_call_return(node.value)
return_type = fn_type.fetch_call_return(node.value)
if (
return_value
return_type
and not isinstance(fn_type, MemberFunctionT)
and not isinstance(fn_type, ContractFunctionT)
):
raise StructureException(
f"Function '{fn_type._id}' cannot be called without assigning the result", node
)
self.expr_visitor.visit(node.value, fn_type)
self.expr_visitor.visit(node.value, return_type)

def visit_For(self, node):
if isinstance(node.iter, vy_ast.Subscript):
Expand Down

0 comments on commit 8b537c4

Please sign in to comment.