# compiler: improve "\.\.\. contains reference to comptime var" errors · gitcafe/zig

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

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

Visibility: public

Requested revision: 04c9f50aec5c1d01ee2c230534454a0ddf551c38

Requested commit: 04c9f50aec5c1d01ee2c230534454a0ddf551c38

Commit: 04c9f50aec5c1d01ee2c230534454a0ddf551c38

Tree: 60b898e67a3a570bf44c15531647c6f575ac5c09

Author: mlugg

Committer: Matthew Lugg

## Message

```
compiler: improve "... contains reference to comptime var" errors

`Sema.explainWhyValueContainsReferenceToComptimeVar` (concise name!)
adds notes to an error explaining how to get from a given `Value` to a
pointer to some `comptime var` (or a comptime field). Previously, this
error could be very opaque in any case where it wasn't obvious where the
comptime var pointer came from; particularly for type captures. Now, the
error notes explain this to the user.

```

## Parents

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

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