# introduce \`@as\` builtin for type coercion · gitcafe/zig

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

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

Visibility: public

Requested revision: 2a6fbbd8fba30b8d24aa966606372f595c102d55

Requested commit: 2a6fbbd8fba30b8d24aa966606372f595c102d55

Commit: 2a6fbbd8fba30b8d24aa966606372f595c102d55

Tree: 1cdb0d029de60a63d3bba24520aa8665536ba65c

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
introduce `@as` builtin for type coercion

This commit also hooks up type coercion (previously called implicit
casting) into the result location mechanism, and additionally hooks up
variable declarations, maintaining the property that:

    var a: T = b;

is semantically equivalent to:

    var a = @as(T, b);

See #1757

```

## Parents

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

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