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:
parent
b580a497fe
commit
b1357d9641
@ -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')
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user