do not analyze functions with pointer if they're not called from comptime or used at runtime #18753
Labels
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
frontend
Tokenization, parsing, AstGen, Sema, and Liveness.
Milestone
Zig Version
0.12.0-dev.2341+92211135f
Steps to Reproduce and Observed Behavior
Expected Behavior
I'd like
fn bad
to not be analyzed, since the comptime code path:My real world use case is that I'm implementing a comptime function that chooses the best implementation of a function based on runtime-available CPU features. I'd like to pass it the function pointer for all possible implementations, but I don't want to include impossible implementations. For example, an ARM NEON implementation on x86_64.
This is me implementing #1018 myself using comptime.
The text was updated successfully, but these errors were encountered: