mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: fix map clone (#7366)
This commit is contained in:
@@ -382,6 +382,9 @@ fn (mut g Gen) method_call(node ast.CallExpr) {
|
||||
g.gen_str_for_type(node.receiver_type)
|
||||
}
|
||||
mut has_cast := false
|
||||
if left_sym.kind == .map && node.name == 'clone' {
|
||||
receiver_type_name = 'map'
|
||||
}
|
||||
// TODO performance, detect `array` method differently
|
||||
if left_sym.kind == .array && node.name in
|
||||
['repeat', 'sort_with_compare', 'free', 'push_many', 'trim', 'first', 'last', 'pop', 'clone', 'reverse', 'slice'] {
|
||||
|
Reference in New Issue
Block a user