Skip to content

For expression w/ else branch trips a few asserts #3961

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
LemonBoy opened this issue Dec 21, 2019 · 1 comment
Closed

For expression w/ else branch trips a few asserts #3961

LemonBoy opened this issue Dec 21, 2019 · 1 comment
Labels
bug Observed behavior contradicts documented or intended behavior stage1 The process of building from source via WebAssembly and the C backend.
Milestone

Comments

@LemonBoy
Copy link
Contributor

Case1:

    var x = [_]u32{ 1, 2 };
    const q = for (x) |y| {
        if ((y & 1) != 0) continue;
        break y * 2;
    } else @as(u32, 1);

Case2:

    var x = [_]u32{ 1, 2 };
    const q = for (x) |y| {
        if ((y & 1) != 0) continue;
        break y * 2;
    } else @panic("");
@daurnimator daurnimator added bug Observed behavior contradicts documented or intended behavior stage1 The process of building from source via WebAssembly and the C backend. labels Dec 22, 2019
@andrewrk andrewrk added this to the 0.6.0 milestone Dec 31, 2019
@andrewrk andrewrk modified the milestones: 0.6.0, 0.7.0 Mar 4, 2020
@andrewrk andrewrk modified the milestones: 0.7.0, 0.8.0 Aug 13, 2020
@andrewrk andrewrk modified the milestones: 0.8.0, 0.9.0 Nov 6, 2020
@andrewrk andrewrk modified the milestones: 0.9.0, 0.10.0 May 19, 2021
@nektro
Copy link
Contributor

nektro commented Oct 12, 2021

first one works now

Vexu added a commit to Vexu/zig that referenced this issue Dec 28, 2022
Vexu added a commit to Vexu/zig that referenced this issue Dec 28, 2022
Vexu added a commit to Vexu/zig that referenced this issue Dec 28, 2022
Vexu added a commit to Vexu/zig that referenced this issue Dec 28, 2022
Vexu added a commit to Vexu/zig that referenced this issue Dec 28, 2022
Vexu added a commit to Vexu/zig that referenced this issue Dec 29, 2022
@andrewrk andrewrk modified the milestones: 0.12.0, 0.11.0 Dec 29, 2022
TUSF pushed a commit to TUSF/zig that referenced this issue May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior stage1 The process of building from source via WebAssembly and the C backend.
Projects
None yet
Development

No branches or pull requests

4 participants