# sema: load the correct AST in addFieldErrNote · gitcafe/zig

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

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

Visibility: public

Requested revision: 6cc2b2616365c2a216f3dd73837f405df094daab

Requested commit: 6cc2b2616365c2a216f3dd73837f405df094daab

Commit: 6cc2b2616365c2a216f3dd73837f405df094daab

Tree: f15575f12a2a54a34418696a3c57e4e55ba95c10

Author: John Schmidt

Committer: John Schmidt

## Message

```
sema: load the correct AST in addFieldErrNote

The enum we want to get the fields from might not be declared in the
same file as the block we are analyzing, so we should get the AST from
the decl's file instead.

Closes #12950.

```

## Parents

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

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