Skip to content

orelse in tuple does not compile #3892

New issue

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

Closed
giann opened this issue Dec 12, 2019 · 2 comments
Closed

orelse in tuple does not compile #3892

giann opened this issue Dec 12, 2019 · 2 comments

Comments

@giann
Copy link
Contributor

giann commented Dec 12, 2019

const std = @import("std");

test "orelse in tuple" {
    var opt: ?u32 = 1;
    std.debug.warn("A tuple: ({}, {}, {})\n", .{ 1, 2, opt orelse 3 });
}
λ zig test tuples.zig

/Users/giann/tmp-code/tuples.zig:5:67: error: duplicate struct field: '2'
    std.debug.warn("A tuple: ({}, {}, {})\n", .{ 1, 2, opt orelse 3 });
                                                                  ^
/Users/giann/tmp-code/tuples.zig:5:67: note: other field here
    std.debug.warn("A tuple: ({}, {}, {})\n", .{ 1, 2, opt orelse 3 });
@ghost
Copy link

ghost commented Dec 12, 2019

Looks like the same thing as #3882

@giann
Copy link
Contributor Author

giann commented Dec 12, 2019

Seems like it i'll add this example to it

@giann giann closed this as completed Dec 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant