1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

fmt: temporary struct attr fix

This commit is contained in:
Alexander Medvednikov 2020-08-19 14:33:42 +02:00
parent d9aae023b1
commit 55b025413d

View File

@ -631,7 +631,7 @@ pub fn (mut f Fmt) struct_decl(node ast.StructDecl) {
f.write('\t$field.name ')
f.write(strings.repeat(` `, max - field.name.len))
f.write(field_types[i])
if field.attrs.len > 0 {
if field.attrs.len > 0 && field.attrs[0].name != 'ref_only' { // TODO a bug with [ref_only] attr being added to fields, fix it
f.write(strings.repeat(` `, max_type - field_types[i].len))
f.inline_attrs(field.attrs)
}