# Fix error reporting the wrong line for struct field inits \(\#13502\) · gitcafe/zig

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

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

Visibility: public

Requested revision: 35c13c262c99c3ae43dfffae0ea4ec331da25255

Requested commit: 35c13c262c99c3ae43dfffae0ea4ec331da25255

Commit: 35c13c262c99c3ae43dfffae0ea4ec331da25255

Tree: 4c116a2fc39d1097f64032ba9540fc77ee122f8a

Author: mparadinha

Committer: Andrew Kelley

## Message

```
Fix error reporting the wrong line for struct field inits (#13502)

* point to init part of field delc when that's where the error occurs

* update test to reflect fixed error message

* only lookup source location in case of error
```

## Parents

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

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