1
0
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:
joe-conigliaro 2020-03-20 15:05:50 +11:00
parent 1fb2c3f5b4
commit ed50fef1c0

View File

@ -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('}')