Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sema: mark pointers to inline functions as comptime-only #17170

Merged
merged 1 commit into from
Sep 16, 2023

Conversation

mlugg
Copy link
Member

@mlugg mlugg commented Sep 15, 2023

This is supposed to be the case, similar to how pointers to generic functions are comptime-only (several pieces of logic already assumed this). These types being considered runtime was causing dbg_var_val AIR instructions to be wrongly emitted for such values, causing codegen backends to create a runtime reference to the inline function, which (at least on the LLVM backend) triggers an error.

Resolves: #38

Verified

This commit was signed with the committer’s verified signature.
mlugg Matthew Lugg
This is supposed to be the case, similar to how pointers to generic
functions are comptime-only (several pieces of logic already assumed
this). These types being considered runtime was causing `dbg_var_val`
AIR instructions to be wrongly emitted for such values, causing codegen
backends to create a runtime reference to the inline function, which (at
least on the LLVM backend) triggers an error.

Resolves: ziglang#38
@andrewrk andrewrk merged commit 6df78c3 into ziglang:master Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

improved error diagnostics when unable to inline a function
2 participants