# Sema: resolve necessary information ahead of time · gitcafe/zig

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

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

Visibility: public

Requested revision: 9d4cfd9048d71d7519d759b9849914ce154d1877

Requested commit: 9d4cfd9048d71d7519d759b9849914ce154d1877

Commit: 9d4cfd9048d71d7519d759b9849914ce154d1877

Tree: e28008bbb3ff86babf48fbe4b80d078e9217c2f3

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
Sema: resolve necessary information ahead of time

Do the fallible logic in Sema where we have access to error reporting
mechanisms, rather than in Type/Value.

We can't just do the best guess when resolving queries of "is this type
comptime only?" or "what is the ABI alignment of this field?". The
result needs to be accurate. So we need to keep the assertions that the
data is available active, and instead compute the necessary information
before such functions get called.

Unfortunately we are stuck with two versions of such functions because
the various backends need to be able to ask such queries of Types and
Values while assuming the result has already been computed and validated
by Sema.

```

## Parents

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

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