# Sema: explain why we tried to call an \`extern fn\` at comptime · gitcafe/zig

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

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

Visibility: public

Requested revision: 107b65ec5dccd360410b4a693bb0caf0015312f3

Requested commit: 107b65ec5dccd360410b4a693bb0caf0015312f3

Commit: 107b65ec5dccd360410b4a693bb0caf0015312f3

Tree: 7cd66974406b4f3423e746f1ca24c0e7f0cabb94

Author: mlugg

Committer: Matthew Lugg

## Message

```
Sema: explain why we tried to call an `extern fn` at comptime

I recently saw a user hit the "comptime call of extern function" error,
and get confused because they didn't know why the scope was `comptime`.
So, use `explainWhyBlockIsComptime` on this and related errors to add
all the relevant notes.

The added test case shows the motivating situation.

```

## Parents

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

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