Skip to content

Expected compile error for unreachable code #5050

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
strangebug opened this issue Apr 15, 2020 · 3 comments
Closed

Expected compile error for unreachable code #5050

strangebug opened this issue Apr 15, 2020 · 3 comments

Comments

@strangebug
Copy link

Hello,
I am a zig beginner so feel free to correct if I missed something.

The foo function is unreachable so zig build don't raise a compilation error.

Zig: 0.6.0
main.zig:

const std = @import("std");

fn foo() void { // Unreachable code
    const y = 1;
    y += 1;
}

pub fn main() void {}
@andrewrk
Copy link
Member

Welcome, @strangebug. Have a look at #335.

@strangebug
Copy link
Author

Sorry, didn't saw that one

@andrewrk
Copy link
Member

No problem! There are many issues open

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

2 participants