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.14.0-dev.208+854e86c56
When I tried to swap two anonymous tuples, the build failed. (on linux x86_64)
const std = @import("std"); pub fn main() void { var a = [_]struct{i32, i32}{.{1, 2}, .{3, 4}}; std.mem.swap(struct{i32, i32}, &a[0], &a[1]); }
Trying to compile it, you get:
$ cat main.zig const std = @import("std"); pub fn main() void { var a = [_]struct{i32, i32}{.{1, 2}, .{3, 4}}; std.mem.swap(struct{i32, i32}, &a[0], &a[1]); } $ zig build-exe main.zig Segmentation fault
However, if I give the tuple a name, it works. This compiles fine:
const std = @import("std"); const Pair = struct{i32, i32}; pub fn main() void { var a = [_]Pair{.{1, 2}, .{3, 4}}; std.mem.swap(Pair, &a[0], &a[1]); }
I tried looking for issues with segfault and swap, but did not find anything.
The compiler should not segfault, it should output a program or an error.
The text was updated successfully, but these errors were encountered:
Duplicate of #19497
Sorry, something went wrong.
No branches or pull requests
Zig Version
0.14.0-dev.208+854e86c56
Steps to Reproduce and Observed Behavior
When I tried to swap two anonymous tuples, the build failed. (on linux x86_64)
Trying to compile it, you get:
However, if I give the tuple a name, it works.
This compiles fine:
I tried looking for issues with segfault and swap, but did not find anything.
Expected Behavior
The compiler should not segfault, it should output a program or an error.
The text was updated successfully, but these errors were encountered: