From 8b537c4b4844d9462e86c39aeb07c31772b5b6ee Mon Sep 17 00:00:00 2001 From: tserg <8017125+tserg@users.noreply.github.com> Date: Mon, 20 Nov 2023 23:49:02 +0800 Subject: [PATCH] fix return type for call stmts --- vyper/semantics/analysis/local.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vyper/semantics/analysis/local.py b/vyper/semantics/analysis/local.py index 647f01c299..bc8b7de2d1 100644 --- a/vyper/semantics/analysis/local.py +++ b/vyper/semantics/analysis/local.py @@ -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):