# stage2 frontend improvements \- \`@ptrCast\` and optionals · gitcafe/zig

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

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

Visibility: public

Requested revision: 55c6a784a5bdf37c90cc9d8f55e9a86d396b8af4

Requested commit: 55c6a784a5bdf37c90cc9d8f55e9a86d396b8af4

Commit: 55c6a784a5bdf37c90cc9d8f55e9a86d396b8af4

Tree: 617bd6b751f54fb946c4233b48d3fac0867674b9

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage2 frontend improvements - `@ptrCast` and optionals

 * AstGen: use coerced_ty ResultLoc on array types and rely on Sema
   doing type coercion, to reduce the size of the ZIR for these
   instructions.

 * Sema: implement `@ptrCast`.

 * Sema: implement coercion from `T` to `?T` with an intermediate
   coercion rather than equality check.

```

## Parents

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

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