mirror of
https://github.com/vlang/v.git
synced 2025-09-09 07:15:50 -04:00
This commit is contained in:
parent
2e0a6ea4d4
commit
8fee351c5b
@ -1502,12 +1502,12 @@ pub fn (mut f Fmt) alias_type_decl(node ast.AliasTypeDecl) {
|
||||
if node.is_pub {
|
||||
f.write('pub ')
|
||||
}
|
||||
// aliases of anon struct: `type foo = struct {}`
|
||||
// aliases of anon struct: `type Foo = struct {}`
|
||||
sym := f.table.sym(node.parent_type)
|
||||
if sym.info is ast.Struct {
|
||||
if sym.info.is_anon {
|
||||
f.write('type ${node.name} = ')
|
||||
f.write_anon_struct_field_decl(node.parent_type, ast.StructDecl{ fields: sym.info.fields })
|
||||
f.struct_decl(ast.StructDecl{ fields: sym.info.fields }, true)
|
||||
f.comments(node.comments, has_nl: false)
|
||||
f.mark_types_import_as_used(node.parent_type)
|
||||
return
|
||||
|
@ -1,9 +1,9 @@
|
||||
pub type Unit1 = struct {}
|
||||
|
||||
pub type Unit2 = struct {
|
||||
name string
|
||||
age int
|
||||
}
|
||||
name string
|
||||
age int
|
||||
}
|
||||
|
||||
pub const unit1 = Unit1{}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user