# stage2: @TypeOf \(\#7475\) · gitcafe/zig

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

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

Visibility: public

Requested revision: cb3198af2af2501c1caf04228736d0b94a371f97

Requested commit: cb3198af2af2501c1caf04228736d0b94a371f97

Commit: cb3198af2af2501c1caf04228736d0b94a371f97

Tree: 012c0f5507068c5fe1e9ec9e8a8f80da872791b9

Author: g-w1

Committer: GitHub

## Message

```
stage2: @TypeOf (#7475)

* stage2: add @TypeOf

* stage2: discriminate on what type of @builtinCall in nodeMayNeedMemoryLocation

* merge upstream into my stash

* add type equality to make easier to test and defer free the types

* remove addDeclErr, I dont know why I added it, its from a different branch that im working on

* add tests

* update error message to match stage1

* use ComptimeStringMap and update which nodes don't need memory from vexu's suggestions

* fix typo

Co-authored-by: Veikka Tuominen <git@vexu.eu>

* make @TypeOf(single_arg) go to .typeof zir inst and add test for that

* unioninit, as, reduce change mayneedmemorylocation

Co-authored-by: Veikka Tuominen <git@vexu.eu>
```

## Parents

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

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