# compiler: fix structFieldName crash for tuples · gitcafe/zig

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

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

Visibility: public

Requested revision: 81b5df347a2b92566dc679fdd4e110812dfe27d0

Requested commit: 81b5df347a2b92566dc679fdd4e110812dfe27d0

Commit: 81b5df347a2b92566dc679fdd4e110812dfe27d0

Tree: 2e2580b944374f490797ef3211eb752c7b1bc051

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
compiler: fix structFieldName crash for tuples

When struct types have no field names, the names are implicitly
understood to be strings corresponding to the field indexes in
declaration order. It used to be the case that a NullTerminatedString
would be stored for each field in this case, however, now, callers must
handle the possibility that there are no names stored at all. This
commit introduces `legacyStructFieldName`, a function to fake the
previous behavior. Probably something better could be done by reworking
all the callsites of this function.

```

## Parents

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

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