cgen: dont add overidden fields in assoc

pull/4077/head
joe-conigliaro 2020-03-20 15:05:50 +11:00
parent 1fb2c3f5b4
commit ed50fef1c0
1 changed files with 3 additions and 0 deletions

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