# AstGen: improve ergonomics of \`Scope\` · gitcafe/zig

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

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

Visibility: public

Requested revision: d840bb511839464c852699acce471efccdd67f3e

Requested commit: d840bb511839464c852699acce471efccdd67f3e

Commit: d840bb511839464c852699acce471efccdd67f3e

Tree: c7eebab23484f8835231e35845273a834202e17c

Author: Justus Klausecker

Committer: Matthew Lugg

## Message

```
AstGen: improve ergonomics of `Scope`

Adds `Scope.Unwrapped`, a simple union of pointers to already-casted scopes
with `Scope.Tag` as its tag enum. This pairs very nicely with labeled switch
and gets rid of almost every `scope.cast(...).?`, improving developer QOL :)

```

## Parents

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

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