mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parent
01b20485c3
commit
5300441c09
@ -1277,7 +1277,7 @@ fn (mut g Gen) method_call(node ast.CallExpr) {
|
||||
g.get_free_method(rec_type)
|
||||
}
|
||||
mut has_cast := false
|
||||
if left_sym.kind == .map && node.name in ['clone', 'move'] {
|
||||
if final_left_sym.kind == .map && node.name in ['clone', 'move'] {
|
||||
receiver_type_name = 'map'
|
||||
}
|
||||
if final_left_sym.kind == .array && !(left_sym.kind == .alias && left_sym.has_method(node.name))
|
||||
|
13
vlib/v/tests/alias_map_clone_test.v
Normal file
13
vlib/v/tests/alias_map_clone_test.v
Normal file
@ -0,0 +1,13 @@
|
||||
type Fields = map[string]string
|
||||
|
||||
fn test_alias_map_clone() {
|
||||
f := Fields({
|
||||
's': 'a'
|
||||
})
|
||||
|
||||
s := f.clone()
|
||||
println(s)
|
||||
assert s == {
|
||||
's': 'a'
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user