zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit b0b9c3c2dc4e55609db44dc0564795b7e2ed1b34 (tree)
parent 18770721ac919abd8d4dc6d117a6798a462106be
Author: Jacob G-W <jacoblevgw@gmail.com>
Date:   Sun, 11 Jul 2021 10:03:47 -0400

stage2: remove redundancy from error message

invalid 'try' outside function scope ->
'try' outside function scope

Diffstat:
Msrc/AstGen.zig | 2+-
Mtest/cases.zig | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/AstGen.zig b/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", .{}); diff --git a/test/cases.zig b/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"}, ); } {