# \`@truncate\`: comptime 0 when target type is 0 bits · gitcafe/zig

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

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

Visibility: public

Requested revision: caf672c49586f1af5e3d41ae200aded991b8b0f7

Requested commit: caf672c49586f1af5e3d41ae200aded991b8b0f7

Commit: caf672c49586f1af5e3d41ae200aded991b8b0f7

Tree: 76b8e9dd955342c6a7ccda3ca62eade39edb4c5f

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
`@truncate`: comptime 0 when target type is 0 bits

also if the dest type is a comptime_int, then treat it
as an implicit cast.

also compile error for attempting to truncate undefined

closes #1568

```

## Parents

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

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