Skip to content

unreachable code error when there is a defer with 0 block exit paths #282

Open
@andrewrk

Description

@andrewrk

Extracted from #110.

Example code:

const std = @import("std");

test "example" {
    defer bar();
    defer foo();
}

fn foo() noreturn {
    while (true) {}
}
fn bar() void {}

expected: error: unreachable code

actual: code compiles

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSolving this issue will likely involve adding new logic or components to the codebase.frontendTokenization, parsing, AstGen, Sema, and Liveness.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions