# Sema: different solution to elemVal · gitcafe/zig

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

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

Visibility: public

Requested revision: cdeb1fb88157130ba1260e6c2d4ef5a20df0c493

Requested commit: cdeb1fb88157130ba1260e6c2d4ef5a20df0c493

Commit: cdeb1fb88157130ba1260e6c2d4ef5a20df0c493

Tree: d510a7942f92292839be15c7bc7e883e8dae428a

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
Sema: different solution to elemVal

I think that reusing the ComptimePtrLoad infrastructure is ultimately
less logic and more robust than adding a `direct` flag to elem_ptr.

 * Some code in zirTypeInfo needed to be fixed to create proper
   Type/Value encodings.
 * comptime elemVal works by constructing an elem_ptr Value and then
   using the already existing pointerDeref function.

There are some remaining calls to Value.elemValue which should be
considered code smells at this point.

```

## Parents

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

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