mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: dont add overidden fields in assoc
This commit is contained in:
parent
1fb2c3f5b4
commit
ed50fef1c0
@ -1445,6 +1445,9 @@ fn (g mut Gen) assoc(node ast.Assoc) {
|
||||
sym := g.table.get_type_symbol(node.typ)
|
||||
info := sym.info as table.Struct
|
||||
for field in info.fields {
|
||||
if field.name in node.fields {
|
||||
continue
|
||||
}
|
||||
g.writeln('\t.$field.name = ${node.var_name}.$field.name,')
|
||||
}
|
||||
g.write('}')
|
||||
|
Loading…
Reference in New Issue
Block a user