We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
if (some_cond) "foo" else "something else"
Currently fails with
error: expected type '*const [3:0]u8', found '*const [14:0]u8'
I propose that peer type resolution in situations like this instead results in a [:0]const u8
[:0]const u8
I also propose that various pointer attributes would have different behaviour:
align
const
The text was updated successfully, but these errors were encountered:
Nevermind, this is already the case; my test snippet was just running into #3882
const std = @import("std"); pub fn main() void { var b = true; var f = if (b) "foo" else "something else"; std.debug.print("{}:{}\n", .{@typeName(@TypeOf(f)), f}); }
Sorry, something went wrong.
No branches or pull requests
Currently fails with
I propose that peer type resolution in situations like this instead results in a
[:0]const u8
I also propose that various pointer attributes would have different behaviour:
align
-> result type should have lowest common denominator of alignment of operandsconst
-> if either type is const, resulting slice is constThe text was updated successfully, but these errors were encountered: