Skip to content
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

AstGen yet another switch result loc bug #11812

Closed
Vexu opened this issue Jun 7, 2022 · 1 comment
Closed

AstGen yet another switch result loc bug #11812

Vexu opened this issue Jun 7, 2022 · 1 comment
Labels
bug Observed behavior contradicts documented or intended behavior frontend Tokenization, parsing, AstGen, Sema, and Liveness.
Milestone

Comments

@Vexu
Copy link
Member

Vexu commented Jun 7, 2022

test {
    const S = struct {
        fn foo() !u8 {
            return error.Foo;
        }
    };
    const value = S.foo() catch |err| switch (err) {
        error.Foo => 255,
    };
    try expect(value == 255);
}
a.zig:14:39: error: value with comptime only type 'comptime_int' depends on runtime control flow
    const value = S.foo() catch |err| switch (err) {
                                      ^
a.zig:14:47: note: runtime control flow here
    const value = S.foo() catch |err| switch (err) {
                                              ^
@Vexu Vexu added bug Observed behavior contradicts documented or intended behavior frontend Tokenization, parsing, AstGen, Sema, and Liveness. labels Jun 7, 2022
@Vexu Vexu added this to the 0.10.0 milestone Jun 7, 2022
@andrewrk andrewrk modified the milestones: 0.10.0, 0.10.1 Oct 12, 2022
@andrewrk andrewrk modified the milestones: 0.10.1, 0.11.0 Jan 10, 2023
@andrewrk andrewrk modified the milestones: 0.11.0, 0.11.1 Jul 20, 2023
@andrewrk
Copy link
Member

andrewrk commented Jan 9, 2024

fixed by acca16c

@andrewrk andrewrk closed this as completed Jan 9, 2024
@andrewrk andrewrk modified the milestones: 0.11.1, 0.12.0 Jan 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 frontend Tokenization, parsing, AstGen, Sema, and Liveness.
Projects
None yet
Development

No branches or pull requests

2 participants