#complete for struct literals with named fields #962
JoshuaManton
started this conversation in
Ideas/Requests
Replies: 2 comments
-
Is it worth making this part of the struct declaration instead of the variable declaration? FWIW, I'd rather #complete not be the default. Because the zero value is meant to be useful in Odin, in most cases #complete won't be necessary. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I agree with jharler that making |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Sometimes I like to do named fields just for clarity, especially for bigger structs. The following would help ensure that using named fields would be robust to new fields being added.
Alternatively, the default could be #complete, like it is for non-named fields, then you would have to do
#complete Foo{x=1, y=4}
.Beta Was this translation helpful? Give feedback.
All reactions