From 18770721ac919abd8d4dc6d117a6798a462106be Mon Sep 17 00:00:00 2001 From: Jacob G-W Date: Sat, 10 Jul 2021 18:19:36 -0400 Subject: stage2 astgen: error for return outside of function scope --- test/compile_errors.zig | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/compile_errors.zig') diff --git a/test/compile_errors.zig b/test/compile_errors.zig index 6ce1774ecf..6075eee33a 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -2,6 +2,10 @@ const std = @import("std"); const TestContext = @import("../src/test.zig").TestContext; pub fn addCases(ctx: *TestContext) !void { + ctx.objErrStage1("issue #9346: return outside of function scope", + \\pub const empty = return 1; + , &.{"tmp.zig:1:19: error: 'return' outside function scope"}); + ctx.exeErrStage1("std.fmt error for unused arguments", \\pub fn main() !void { \\ @import("std").debug.print("{d} {d} {d} {d} {d}", .{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}); -- cgit v1.2.3