AstGen: use reachableExpr for return operand

Related: #9630
This commit is contained in:
Andrew Kelley
2021-11-24 14:47:33 -07:00
parent 57e1f6a89f
commit c42763f8cc
7 changed files with 15 additions and 6 deletions
+9
View File
@@ -4999,6 +4999,15 @@ pub fn addCases(ctx: *TestContext) !void {
"tmp.zig:2:5: note: control flow is diverted here",
});
ctx.objErrStage1("unreachable code - return return",
\\export fn a() i32 {
\\ return return 1;
\\}
, &[_][]const u8{
"tmp.zig:2:5: error: unreachable code",
"tmp.zig:2:12: note: control flow is diverted here",
});
ctx.objErrStage1("bad import",
\\const bogus = @import("bogus-does-not-exist.zig",);
, &[_][]const u8{