File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -492,13 +492,10 @@ fn (mut g Gen) comptime_for(node ast.ComptimeFor) {
492492 } else if node.kind == .fields {
493493 // TODO add fields
494494 if sym.info is ast.Struct {
495- mut fields := sym.info.fields.filter (it .attrs.len == 0 )
496- fields_with_attrs := sym.info.fields.filter (it .attrs.len > 0 )
497- fields << fields_with_attrs
498- if fields.len > 0 {
495+ if sym.info.fields.len > 0 {
499496 g.writeln ('\t FieldData $node.val_var = {0};' )
500497 }
501- for field in fields {
498+ for field in sym.info. fields {
502499 g.comptime_for_field_var = node.val_var
503500 g.comptime_for_field_value = field
504501 g.writeln ('/* field $i */ {' )
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ fn print_field_values<T>(s T) {
4343
4444struct Foo {
4545 name string
46- password string
46+ password string [this_will_not_change_the_order]
4747 email string
4848 age int
4949}
You can’t perform that action at this time.
0 commit comments