# AstGen: add source location to certain const initializers · gitcafe/zig

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

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

Visibility: public

Requested revision: b9c4857ed64fb18fa8cbc69112fd4fb4f8a5ac68

Requested commit: b9c4857ed64fb18fa8cbc69112fd4fb4f8a5ac68

Commit: b9c4857ed64fb18fa8cbc69112fd4fb4f8a5ac68

Tree: 48f6dde6a95bf44cadca07492f92fad5aca2ec85

Author: Jacob Young

Committer: Andrew Kelley

## Message

```
AstGen: add source location to certain const initializers

Before:

    assign_local_bad_coercion.zig:5:1: error: expected type 'u32', found 'u64'
    export fn constEntry() u32 {
    ^~~~~~
    assign_local_bad_coercion.zig:11:19: error: expected type 'u32', found 'u64'
        var x: u32 = g();
                     ~^~

After:

    assign_local_bad_coercion.zig:6:21: error: expected type 'u32', found 'u64'
        const x: u32 = g();
                       ~^~
    assign_local_bad_coercion.zig:11:19: error: expected type 'u32', found 'u64'
        var x: u32 = g();
                     ~^~

```

## Parents

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

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