We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.11.0-dev.63+8c4faa5f3
I used to be able to create error unions using @field:
@field
const std = @import("std"); pub fn main() void { const e = @field(anyerror, "NotFound"); std.debug.print("{}\n", .{@TypeOf(e)}); }
This was a handy way of creating error unions at compile time.
But now @TypeOf(e) is always anyerror
@TypeOf(e)
anyerror
Stage1 evaluates TypeOf(e) to error{NotFound}
TypeOf(e)
error{NotFound}
The text was updated successfully, but these errors were encountered:
I can use @Type for now, until its removed from the language.
@Type
const E = @Type(std.builtin.Type{ .ErrorSet = &[_]std.builtin.Type.Error{.{ .name = "NotFound", }}, }); var e = @field(E, "NotFound");
#10710
Sorry, something went wrong.
Sema: adjust result type of anyerror field access
6d421aa
Closes ziglang#13448
5d28d17
No branches or pull requests
Zig Version
0.11.0-dev.63+8c4faa5f3
Steps to Reproduce and Observed Behavior
I used to be able to create error unions using
@field
:This was a handy way of creating error unions at compile time.
But now
@TypeOf(e)
is alwaysanyerror
Expected Behavior
Stage1 evaluates
TypeOf(e)
toerror{NotFound}
The text was updated successfully, but these errors were encountered: