Commit b0b9c3c2dc

Jacob G-W <jacoblevgw@gmail.com>
2021-07-11 16:03:47
stage2: remove redundancy from error message
invalid 'try' outside function scope -> 'try' outside function scope
1 parent 1877072
Changed files (2)
src/AstGen.zig
@@ -4604,7 +4604,7 @@ fn tryExpr(
     const astgen = parent_gz.astgen;
 
     const fn_block = astgen.fn_block orelse {
-        return astgen.failNode(node, "invalid 'try' outside function scope", .{});
+        return astgen.failNode(node, "'try' outside function scope", .{});
     };
 
     if (parent_gz.in_defer) return astgen.failNode(node, "'try' not allowed inside defer expression", .{});
test/cases.zig
@@ -903,7 +903,7 @@ pub fn addCases(ctx: *TestContext) !void {
             \\    _ = S;
             \\}
         ,
-            &.{":4:13: error: invalid 'try' outside function scope"},
+            &.{":4:13: error: 'try' outside function scope"},
         );
     }
     {