# Sema: fix empty struct init · gitcafe/zig

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

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

Visibility: public

Requested revision: 88be5bd81decab792cdb5b749b4bb5cf6d71e877

Requested commit: 88be5bd81decab792cdb5b749b4bb5cf6d71e877

Commit: 88be5bd81decab792cdb5b749b4bb5cf6d71e877

Tree: f5eed00970c7e97581e8382ae37d08ef177d431f

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
Sema: fix empty struct init

 * Extract common logic between `zirStructInitEmpty` and
   `zirStructInit`.
 * `resolveTypeFields` additionally sets status to `have_layout` if the
   total number of fields is 0.

```

## Parents

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

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