# Sema: @extern fixes · gitcafe/zig

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

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

Visibility: public

Requested revision: c93e0d86187cb589d6726acd36f741f3d87a96be

Requested commit: c93e0d86187cb589d6726acd36f741f3d87a96be

Commit: c93e0d86187cb589d6726acd36f741f3d87a96be

Tree: 3e812c1fcd520086b45cc22cbc890fb24f432b57

Author: mlugg

Committer: Veikka Tuominen

## Message

```
Sema: @extern fixes

* There was an edge case where the arena could be destroyed twice on
  error: once from the arena itself and once from the decl destruction.

* The type of the created decl was incorrect (it should have been the
  pointer child type), but it's not required anyway, so it's now just
  initialized to anyopaque (which more accurately reflects what's
  actually at that memory, since e.g. [*]T may correspond to nothing).

* A runtime bitcast of the pointer was performed, meaning @extern didn't
  work at comptime. This is unnecessary: the decl_ref can just be
  initialized with the correct pointer type.

```

## Parents

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

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