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

parser: remove attributes from anonymous structs (fixes #18233)

This commit is contained in:
Alexander Medvednikov 2023-05-22 14:13:16 +02:00
parent c382f4d310
commit a33ffcedfb
2 changed files with 8 additions and 1 deletions

View File

@ -44,3 +44,10 @@ struct KeepMultiLineDefaultExprsIndent {
text: 'M5'
}]
}
[typedef]
struct C.some_t {
@type int
data struct {}
}

View File

@ -387,7 +387,7 @@ fn (mut p Parser) struct_decl(is_anon bool) ast.StructDecl {
module_pos: module_pos
language: language
is_union: is_union
attrs: attrs
attrs: if is_anon { []ast.Attr{} } else { attrs } // anon structs can't have attributes
end_comments: end_comments
generic_types: generic_types
embeds: embeds