-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.This issue suggests modifications. If it also has the "accepted" label then it is planned.
Milestone
Description
const assert = @import("std").debug.assert;
const warn = @import("std").debug.warn;
fn v(comptime T:type, vv: fn()T)T {
const L = struct {
fn a(vv2:fn()T) T {
return vv2();
}
fn b(vv1:fn()T) T {
return a(vv1);
}
};
return L.b(vv);
}
fn voidy() void {
}
fn noreturny() noreturn {
while(true){}
}
test "noreturny?" {
v(void, voidy);
v(noreturn, noreturny);
}/tmp/emb/test.zig:14:5: error: unreachable code
return L.b(vv);
"unreachable code" in general looks like a lint aiming for clean code, not a hard error preventing compilation.
There should be either
- Ignoring code being unreachable only because of
noreturncoming from genericT - Explicit suppressing of unreachable code check.
Metadata
Metadata
Assignees
Labels
proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.This issue suggests modifications. If it also has the "accepted" label then it is planned.