File tree Expand file tree Collapse file tree 4 files changed +8
-3
lines changed Expand file tree Collapse file tree 4 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ pub mut:
47
47
// cache for type_to_str_using_aliases
48
48
cached_type_to_str map [u64 ]string
49
49
anon_struct_names map [string ]int // anon struct name -> struct sym idx
50
+ // counter for anon struct, avoid name conflicts.
51
+ anon_struct_counter int
50
52
}
51
53
52
54
// used by vls to avoid leaks
Original file line number Diff line number Diff line change 91
91
if_cond_comments []ast.Comment
92
92
script_mode bool
93
93
script_mode_start_token token.Token
94
- anon_struct_counter int
95
94
pub mut :
96
95
scanner & scanner.Scanner
97
96
errors []errors.Error
Original file line number Diff line number Diff line change @@ -41,8 +41,8 @@ fn (mut p Parser) struct_decl(is_anon bool) ast.StructDecl {
41
41
return ast.StructDecl{}
42
42
}
43
43
mut name := if is_anon {
44
- p.anon_struct_counter++
45
- '_VAnonStruct$p.anon_struct_counter '
44
+ p.table. anon_struct_counter++
45
+ '_VAnonStruct$p.table. anon_struct_counter '
46
46
} else {
47
47
p.check_name ()
48
48
}
Original file line number Diff line number Diff line change @@ -261,3 +261,7 @@ fn test_fn_is_html_open_tag() {
261
261
b = is_html_open_tag ('style' , s)
262
262
assert b == false
263
263
}
264
+
265
+ // For issue #15516
266
+ fn test_anon_struct () {
267
+ }
You can’t perform that action at this time.
0 commit comments