# Sema: add a strategy for handling costly source locations · gitcafe/zig

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

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

Visibility: public

Requested revision: 3c5927fb87034affd6af56ecd5d9ae07fe23d690

Requested commit: 3c5927fb87034affd6af56ecd5d9ae07fe23d690

Commit: 3c5927fb87034affd6af56ecd5d9ae07fe23d690

Tree: da0d37df4e9379632b44ac2fc3145db5ee49cf1f

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
Sema: add a strategy for handling costly source locations

Now you can pass `.unneeded` for a `LazySrcLoc` and if there ended up
being a compile error that needed it, you'll get
`error.NeededSourceLocation`.

Callsites can now exploit this error to do the expensive computation
to produce a source location object and then repeat the operation.

```

## Parents

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

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