# Sema: fix callconv detection in generic functions · gitcafe/zig

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

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

Visibility: public

Requested revision: f37d0725fa4c6a0b5e4e9ca4d25e2760dc06764d

Requested commit: f37d0725fa4c6a0b5e4e9ca4d25e2760dc06764d

Commit: f37d0725fa4c6a0b5e4e9ca4d25e2760dc06764d

Tree: 33b6fd35a429d3af5ebddeb47e29f428aa212e82

Author: mlugg

Committer: mlugg

## Message

```
Sema: fix callconv detection in generic functions

When analyzing `zirFunc` to instantiate a generic function,
`sema.owner_decl` is not the owner Decl of the generic instance, but
instead of the call site, so that dependencies are propagated correctly.
(This aligns with the fact that in future, generic instantiations will
not have a corresponding `Cau`.) So, when deciding the callconv in this
case, we must check `sema.generic_owner` to determine whether the
function is exported.

```

## Parents

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

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