# AstGen: emit debug stmt for try · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/feb90f6ed4f64eb0faef8fbbcf8c51fad5392b39)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: feb90f6ed4f64eb0faef8fbbcf8c51fad5392b39

Requested commit: feb90f6ed4f64eb0faef8fbbcf8c51fad5392b39

Commit: feb90f6ed4f64eb0faef8fbbcf8c51fad5392b39

Tree: 39e5fc83c905256d24a903ed8b6f56c26b5102b6

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

````
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.

````

## Parents

- [0648177ed7a1ad5364c478b63ec28a6de15e4ad9](https://git.cafe/gitcafe/zig/commit/0648177ed7a1ad5364c478b63ec28a6de15e4ad9?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/feb90f6ed4f64eb0faef8fbbcf8c51fad5392b39?format=markdown)
