checker: minor cleanup in `call_method` (#9066)

pull/9084/head
StunxFS 2021-03-03 04:07:16 -04:00 committed by GitHub
parent 094936d764
commit dad7c40306
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 5 deletions

View File

@ -1360,11 +1360,9 @@ pub fn (mut c Checker) call_method(mut call_expr ast.CallExpr) table.Type {
// check fn
c.check_map_and_filter(true, elem_typ, call_expr)
arg_sym := c.table.get_type_symbol(arg_type)
// FIXME: match expr failed for now
mut ret_type := 0
match mut arg_sym.info {
table.FnType { ret_type = arg_sym.info.func.return_type }
else { ret_type = arg_type }
ret_type := match arg_sym.info {
table.FnType { arg_sym.info.func.return_type }
else { arg_type }
}
call_expr.return_type = c.table.find_or_register_array(ret_type)
} else if method_name == 'filter' {