You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You have 2 options for initializing a struct, whether it has 0 or more fields:
Option 1, recommended, list all the fields in the initializer. With a struct with no fields, there are 0 fields in the initializer. This option is recommended because if you add a field later, you'll get a compiler error here for not initializing all fields.
Copied on request from #548 (comment).
Zig requires initialization, even for empty structs:
results in :
While empty struct does not make much of sense, asking for its initialization is IMO error.
The text was updated successfully, but these errors were encountered: