mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: handle map.clone()
This commit is contained in:
parent
8ea0c812a2
commit
b4d88ee4af
@ -731,6 +731,10 @@ pub fn (mut c Checker) call_method(mut call_expr ast.CallExpr) table.Type {
|
||||
// call_expr.return_type = call_expr.receiver_type
|
||||
}
|
||||
return call_expr.return_type
|
||||
} else if left_type_sym.kind == .map && method_name == 'clone' {
|
||||
call_expr.return_type = left_type
|
||||
call_expr.receiver_type = left_type.to_ptr()
|
||||
return call_expr.return_type
|
||||
} else if left_type_sym.kind == .array && method_name in ['first', 'last'] {
|
||||
info := left_type_sym.info as table.Array
|
||||
call_expr.return_type = info.elem_type
|
||||
|
Loading…
Reference in New Issue
Block a user