mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-27 19:09:47 +03:00
AstGen: require binary operations to have reachable operands
This commit is contained in:
@@ -5033,13 +5033,18 @@ pub fn addCases(ctx: *TestContext) !void {
|
||||
"tmp.zig:2:5: note: control flow is diverted here",
|
||||
});
|
||||
|
||||
ctx.objErrStage1("unreachable code - return return",
|
||||
ctx.objErrStage1("unreachable code - multiple things",
|
||||
\\export fn a() i32 {
|
||||
\\ return return 1;
|
||||
\\}
|
||||
\\export fn b(value: u32) bool {
|
||||
\\ return 1 < value < 1000;
|
||||
\\}
|
||||
, &[_][]const u8{
|
||||
"tmp.zig:2:5: error: unreachable code",
|
||||
"tmp.zig:2:12: note: control flow is diverted here",
|
||||
"tmp.zig:5:22: error: unreachable code",
|
||||
"tmp.zig:5:5: note: control flow is diverted here",
|
||||
});
|
||||
|
||||
ctx.objErrStage1("bad import",
|
||||
|
||||
Reference in New Issue
Block a user