# Sema: change how undefined is handled in coerce · gitcafe/zig

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

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

Visibility: public

Requested revision: 1d1364c3cd296d628501bce131513ce18d2055a3

Requested commit: 1d1364c3cd296d628501bce131513ce18d2055a3

Commit: 1d1364c3cd296d628501bce131513ce18d2055a3

Tree: 1cbd0803b10a57c980edca7223875d15e5a41af9

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
Sema: change how undefined is handled in coerce

Instead of doing it before the switch tower, do it afterwards, so that
special handling may be done before undefined gets casted to the
destination type.

In this case the special handling we want to do is *[N]T to []T setting
the slice length based on the array length, even when the array value is
undefined.

```

## Parents

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

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