# stage2: remove 2 assertions that were too aggressive · gitcafe/zig

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

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

Visibility: public

Requested revision: e03095f167cf0cd8c1424bff0de3c0a7b5f66b18

Requested commit: e03095f167cf0cd8c1424bff0de3c0a7b5f66b18

Commit: e03095f167cf0cd8c1424bff0de3c0a7b5f66b18

Tree: 5981b50b570382137f1cf4c1eb2f528cc6962f21

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage2: remove 2 assertions that were too aggressive

 * `Type.hasCodeGenBits` this function is used to find out if it ever
   got sent to a linker backend for lowering. In the case that a struct
   never has its struct fields resolved, this will be false. In such a
   case, no corresponding `freeDecl` needs to be issued to the linker
   backend. So instead of asserting the fields of a struct are resolved,
   this function now returns `false` for this case.

 * `Module.clearDecl` there was logic that asserted when there is no
   outdated_decls map, any dependants of a Decl being cleared had to be
   in the deletion set. However there is a possible scenario where the
   dependant is not in the deletion set *yet* because there is a Decl
   which depends on it, about to be deleted. If it were added to an
   outdated_decls map, it would be subsequently removed from the map
   when it gets deleted recursively through its dependency being
   deleted.

These issues were uncovered via unrelated changes which are the two
commits immediately preceding this one.

```

## Parents

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

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