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

No type inference when orelse RHS is a block #1989

Open
Vexu opened this issue Aug 5, 2024 · 0 comments
Open

No type inference when orelse RHS is a block #1989

Vexu opened this issue Aug 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Vexu
Copy link
Contributor

Vexu commented Aug 5, 2024

Zig Version

0.14.0-dev.564+75cf7fca9

Zig Language Server Version

dfe958e

Client / Code Editor / Extensions

vscode

Steps to Reproduce and Observed Behavior

test {
    var s: ?u32 = undefined;
    var a = s orelse {
        return;
    };
    var b = s orelse return;
    var c = s.?;
    _ = .{ &s, &a, &b, &c };
}

Expected Behavior

a, b, and c should all be inferred to be u32s but a is not.

Relevant log output

No response

@Vexu Vexu added the bug Something isn't working label Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant