General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
34.58k
stars
2.53k
forks
source link
Multi return statement on a single line doesn't cause a compilation error #21787
Open
eddineimad0 opened 3 hours ago
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