mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
stage2: remove redundancy from error message
invalid 'try' outside function scope -> 'try' outside function scope
This commit is contained in:
parent
18770721ac
commit
b0b9c3c2dc
2 changed files with 2 additions and 2 deletions
|
|
@ -4604,7 +4604,7 @@ fn tryExpr(
|
||||||
const astgen = parent_gz.astgen;
|
const astgen = parent_gz.astgen;
|
||||||
|
|
||||||
const fn_block = astgen.fn_block orelse {
|
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", .{});
|
if (parent_gz.in_defer) return astgen.failNode(node, "'try' not allowed inside defer expression", .{});
|
||||||
|
|
|
||||||
|
|
@ -903,7 +903,7 @@ pub fn addCases(ctx: *TestContext) !void {
|
||||||
\\ _ = S;
|
\\ _ = S;
|
||||||
\\}
|
\\}
|
||||||
,
|
,
|
||||||
&.{":4:13: error: invalid 'try' outside function scope"},
|
&.{":4:13: error: 'try' outside function scope"},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue