# compiler: merge struct default value resolution into layout resolution · gitcafe/zig

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

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

Visibility: public

Requested revision: 2d6ed0d8e6c5d63e04ee90838297b5a87b9dec87

Requested commit: 2d6ed0d8e6c5d63e04ee90838297b5a87b9dec87

Commit: 2d6ed0d8e6c5d63e04ee90838297b5a87b9dec87

Tree: 9e4e554f54167c44fcea74792f9d4121b5a2d235

Author: Matthew Lugg

Committer: Matthew Lugg

## Message

```
compiler: merge struct default value resolution into layout resolution

This actually doesn't cause any dependency loops in std, which is pretty
much my benchmark for it being acceptable. This can be reverted if it
turns out to be problematic, but for now, let's err on the side of
language simplicity.

To be clear, this *does* regress some cases which previously worked: I
will have to remove some behavior tests as a result of this commit. To
be honest, the tests which look to be failing as a result of this are
things which I think are generally unadvisable; I actually reckon a bit
more friction to use default field values in non-trivial ways might be a
good thing to stop people from misusing them as much. Struct fields
should very rarely have default values; about the only common situation
where they make sense is "options" structs.

```

## Parents

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

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