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
This was mentioned in #3652 but I don't think it got much discussion after that.
Structs/unions:
make zig fmt convert Foo{.a = b} to @as(Foo, .{.a = b}), wait 1 release cycle, and remove the deprecated old syntax. If this looks bad to you, consider that most struct literals will look like this: const foo: Foo = .{.a = b};.
Enums:
That's a good point - you could make an analogy with Enum.name being redundant with @as(Enum, .name).
The text was updated successfully, but these errors were encountered:
let's leave it be for a bit, and see how it feels. If it makes it worse in practice to use @as(Foo, .{.a = b}) rather than Foo{.a = b}, then it's worth considering to keep the redundant syntax.
daurnimator
added
the
proposal
This issue suggests modifications. If it also has the "accepted" label then it is planned.
label
Aug 31, 2020
If .{} worked with error unions this wouldn't probably be too much and the same with [_]T{} in the case of &[_]T{}. then it would possibly be better at the cost of being slightly more noisy.
This was mentioned in #3652 but I don't think it got much discussion after that.
Structs/unions:
Enums:
The text was updated successfully, but these errors were encountered: