# Sema: don't delete reified enum type with error in field · gitcafe/zig

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

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

Visibility: public

Requested revision: 3fb5cad07dd3b10ad32a116cbd7195218b0a93fe

Requested commit: 3fb5cad07dd3b10ad32a116cbd7195218b0a93fe

Commit: 3fb5cad07dd3b10ad32a116cbd7195218b0a93fe

Tree: fc4ce5844b794bc131a4dde5b4ae2d4885e29ba4

Author: mlugg

Committer: Jacob Young

## Message

```
Sema: don't delete reified enum type with error in field

An enum type is kind of like a struct or union type, in that field
errors are happening during type resolution. The only difference is that
type resolution happens at the time the type is created. So, errors in
fields should not cause the type to be deleted: we've already added a
reference entry, and incremenetal dependencies which must be invalidated
if the compile error is fixed. Once we call `WipEnumType.prepare`, we
should never call `WipEnumType.cancel`. This is analagous to logic for
enum declarations in `Sema.zirEnumDecl`.

```

## Parents

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

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