1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

v2: checker: fix filter()

This commit is contained in:
Alexander Medvednikov 2020-02-27 16:51:39 +01:00
parent b580a497fe
commit b1357d9641
2 changed files with 22 additions and 17 deletions

View File

@ -20,6 +20,7 @@ fn launch_tool(is_verbose bool, tname string, cmdname string) {
tname_index = os.args.len tname_index = os.args.len
} }
mut compilation_options := os.args[1..tname_index].clone() mut compilation_options := os.args[1..tname_index].clone()
//f := os.args.join(' ')
tool_args := os.args[1..].join(' ') tool_args := os.args[1..].join(' ')
tool_exe := path_of_executable(os.realpath('$vroot/cmd/tools/$tname')) tool_exe := path_of_executable(os.realpath('$vroot/cmd/tools/$tname'))
tool_source := os.realpath('$vroot/cmd/tools/${tname}.v') tool_source := os.realpath('$vroot/cmd/tools/${tname}.v')

View File

@ -222,6 +222,10 @@ pub fn (c mut Checker) check_method_call_expr(method_call_expr ast.MethodCallExp
return method.return_type return method.return_type
} }
} }
if typ_sym.kind == .array && method_call_expr.name == 'filter' {
// info := typ_sym.info as table.Array
return typ // info.elem_type
}
c.error('type `$typ_sym.name` has no method `$method_call_expr.name`', method_call_expr.pos) c.error('type `$typ_sym.name` has no method `$method_call_expr.name`', method_call_expr.pos)
return table.void_type return table.void_type
} }