# Sema: rewrite semantic analysis of function calls · gitcafe/zig

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

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

Visibility: public

Requested revision: e9bd2d45d4bbaf7eff7e95bc3ef7a0123b66a103

Requested commit: e9bd2d45d4bbaf7eff7e95bc3ef7a0123b66a103

Commit: e9bd2d45d4bbaf7eff7e95bc3ef7a0123b66a103

Tree: da18bc40935c7dd9698d792eae3d102fa0ad67ae

Author: mlugg

Committer: mlugg

## Message

```
Sema: rewrite semantic analysis of function calls

This rewrite improves some error messages, hugely simplifies the logic,
and fixes several bugs. One of these bugs is technically a new rule
which Andrew and I agreed on: if a parameter has a comptime-only type
but is not declared `comptime`, then the corresponding call argument
should not be *evaluated* at comptime; only resolved. Implementing this
required changing how function types work a little, which in turn
required allowing a new kind of function coercion for some generic use
cases: function coercions are now allowed to implicitly *remove*
`comptime` annotations from parameters with comptime-only types. This is
okay because removing the annotation affects only the call site.

Resolves: #22262

```

## Parents

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

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