AstGen: emit debug stmt for try

This improves the following test case:

```zig
pub fn main() !void {
    try foo();
}

fn foo() !void {
    return error.Bad;
}
```

The error return trace now points to the `try` token instead of pointing
to the foo() function call, matching stage1.

Closes #12308.
This commit is contained in:
Andrew Kelley
2022-08-08 20:53:06 -07:00
parent 0648177ed7
commit feb90f6ed4
2 changed files with 20 additions and 8 deletions

View File

@@ -22,6 +22,7 @@ pub fn addCases(cases: *tests.StackTracesContext) void {
.ReleaseSafe = .{
.exclude_os = .{
.windows, // segfault
.linux, // defeated by aggressive inlining
},
.expect =
\\error: TheSkyIsFalling