From d40a5029811a04c7a68b8b1bac3df829d5178ab0 Mon Sep 17 00:00:00 2001 From: yuyi Date: Thu, 31 Mar 2022 02:05:17 +0800 Subject: [PATCH] checker: minor cleanup in fn_call() (#13873) --- vlib/v/checker/fn.v | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/vlib/v/checker/fn.v b/vlib/v/checker/fn.v index 8f3ed07b7b..00af1bb7d1 100644 --- a/vlib/v/checker/fn.v +++ b/vlib/v/checker/fn.v @@ -529,29 +529,29 @@ pub fn (mut c Checker) fn_call(mut node ast.CallExpr, mut continue_check &bool) sym := c.table.sym(expr.left_type) if sym.kind == .array { info := sym.info as ast.Array - elem_typ := c.table.sym(info.elem_type) - if elem_typ.info is ast.FnType { - node.return_type = elem_typ.info.func.return_type - return elem_typ.info.func.return_type + elem_sym := c.table.sym(info.elem_type) + if elem_sym.info is ast.FnType { + node.return_type = elem_sym.info.func.return_type + return elem_sym.info.func.return_type } else { c.error('cannot call the element of the array, it is not a function', node.pos) } } else if sym.kind == .map { info := sym.info as ast.Map - value_typ := c.table.sym(info.value_type) - if value_typ.info is ast.FnType { - node.return_type = value_typ.info.func.return_type - return value_typ.info.func.return_type + value_sym := c.table.sym(info.value_type) + if value_sym.info is ast.FnType { + node.return_type = value_sym.info.func.return_type + return value_sym.info.func.return_type } else { c.error('cannot call the value of the map, it is not a function', node.pos) } } else if sym.kind == .array_fixed { info := sym.info as ast.ArrayFixed - elem_typ := c.table.sym(info.elem_type) - if elem_typ.info is ast.FnType { - node.return_type = elem_typ.info.func.return_type - return elem_typ.info.func.return_type + elem_sym := c.table.sym(info.elem_type) + if elem_sym.info is ast.FnType { + node.return_type = elem_sym.info.func.return_type + return elem_sym.info.func.return_type } else { c.error('cannot call the element of the array, it is not a function', node.pos)