| author | |
| committer | |
| log | b0b9c3c2dc4e55609db44dc0564795b7e2ed1b34 |
| tree | 01f083152164cce7d97eb7f52de3e324eb118932 |
| parent | 18770721ac919abd8d4dc6d117a6798a462106be |
invalid 'try' outside function scope ->
'try' outside function scope2 files changed, 2 insertions(+), 2 deletions(-)
src/AstGen.zig+1-1| ... | @@ -4604,7 +4604,7 @@ fn tryExpr( | ... | @@ -4604,7 +4604,7 @@ fn tryExpr( |
| 4604 | const astgen = parent_gz.astgen; | 4604 | const astgen = parent_gz.astgen; |
| 4605 | 4605 | ||
| 4606 | const fn_block = astgen.fn_block orelse { | 4606 | const fn_block = astgen.fn_block orelse { |
| 4607 | return astgen.failNode(node, "invalid 'try' outside function scope", .{}); | 4607 | return astgen.failNode(node, "'try' outside function scope", .{}); |
| 4608 | }; | 4608 | }; |
| 4609 | 4609 | ||
| 4610 | if (parent_gz.in_defer) return astgen.failNode(node, "'try' not allowed inside defer expression", .{}); | 4610 | if (parent_gz.in_defer) return astgen.failNode(node, "'try' not allowed inside defer expression", .{}); |
test/cases.zig+1-1| ... | @@ -903,7 +903,7 @@ pub fn addCases(ctx: *TestContext) !void { | ... | @@ -903,7 +903,7 @@ pub fn addCases(ctx: *TestContext) !void { |
| 903 | \\ _ = S; | 903 | \\ _ = S; |
| 904 | \\} | 904 | \\} |
| 905 | , | 905 | , |
| 906 | &.{":4:13: error: invalid 'try' outside function scope"}, | 906 | &.{":4:13: error: 'try' outside function scope"}, |
| 907 | ); | 907 | ); |
| 908 | } | 908 | } |
| 909 | { | 909 | { |