Zig Version
0.13.0
Steps to Reproduce and Observed Behavior
The following function exhibits the bug.
pub inline fn bytesPerChannel(self:*const Image)usize{
return ((return self.chan_bit_depth - 1) >> 3) + 1;
}
only the inner return statement is evaluated and the outter one is ignored and unreachable, yet zig compiler doesn't throw any errors.
Expected Behavior
The compiler should throw an error upon encountering unreachable return statements same way the following code does
pub inline fn bytesPerChannel(self:*const Image)usize{
return ((self.chan_bit_depth - 1) >> 3) + 1;
return 0;
}
Zig Version
0.13.0
Steps to Reproduce and Observed Behavior
The following function exhibits the bug.
only the inner return statement is evaluated and the outter one is ignored and unreachable, yet zig compiler doesn't throw any errors.
Expected Behavior
The compiler should throw an error upon encountering unreachable return statements same way the following code does