# Sema: fix requiresComptime infinite recursion · gitcafe/zig

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

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

Visibility: public

Requested revision: 4fccc95b0152aefeb40912768ec045b57a2fdc2b

Requested commit: 4fccc95b0152aefeb40912768ec045b57a2fdc2b

Commit: 4fccc95b0152aefeb40912768ec045b57a2fdc2b

Tree: 711ec4766c0cd236b239eb448398d2162c770068

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
Sema: fix requiresComptime infinite recursion

When asking a struct or union whether the type requires comptime, it may
need to ask itself recursively, for example because of a field which is
a pointer to itself. This commit adds a field to each to keep track of
when computing the "requires comptime" value and returns `false` if the
check is already ongoing.

```

## Parents

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

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