mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vfmt: fix union {}
declarations
This commit is contained in:
parent
4ccb219079
commit
ae241785bf
@ -572,7 +572,11 @@ pub fn (mut f Fmt) struct_decl(node ast.StructDecl) {
|
|||||||
if node.is_pub {
|
if node.is_pub {
|
||||||
f.write('pub ')
|
f.write('pub ')
|
||||||
}
|
}
|
||||||
f.write('struct ')
|
if node.is_union {
|
||||||
|
f.write('union ')
|
||||||
|
} else {
|
||||||
|
f.write('struct ')
|
||||||
|
}
|
||||||
f.write_language_prefix(node.language)
|
f.write_language_prefix(node.language)
|
||||||
name := node.name.after('.')
|
name := node.name.after('.')
|
||||||
f.writeln('$name {')
|
f.writeln('$name {')
|
||||||
|
4
vlib/v/fmt/tests/union_keep.vv
Normal file
4
vlib/v/fmt/tests/union_keep.vv
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
union Un {
|
||||||
|
i int
|
||||||
|
b byte
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user