We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
My intention here is to have a function pointer argument that's marked as compile time constant so that it can be inlined.
In the case that this is not supported, it's still a bug since the compiler shouldn't choke on it.
recursive_func :: proc(i : int, $test : proc(int) -> bool) { if (test(i)) { recursive_func(i + 1, test) } } testfunc :: proc(i : int) -> bool { return i < 10 }
Inlining of test(i) when recursive_func is called with a concrete argument.
test(i)
recursive_func
Compiler hangs forever. First it allocates a lot of memory for a while, and then it ramps up CPU usage.
Not appliable
Please provide detailed steps for reproducing the issue.
package main main :: proc() { recursive_func(0, testfunc) } recursive_func :: proc(i : int, $test : proc(int) -> bool) { if (test(i)) { recursive_func(i + 1, test) } } testfunc :: proc(i : int) -> bool { return i < 10 }
odin build . -debug -show-timings
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Context
My intention here is to have a function pointer argument that's marked as compile time constant so that it can be inlined.
In the case that this is not supported, it's still a bug since the compiler shouldn't choke on it.
Odin: dev-2025-02-nightly:584fdc0
OS: Windows 11 Home Basic (version: 23H2), build 22631.4751
CPU: AMD Ryzen Z1 Extreme
RAM: 9937 MiB
Backend: LLVM 18.1.8
Expected Behavior
Inlining of
test(i)
whenrecursive_func
is called with a concrete argument.Current Behavior
Compiler hangs forever. First it allocates a lot of memory for a while, and then it ramps up CPU usage.
Failure Information (for bugs)
Not appliable
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
The text was updated successfully, but these errors were encountered: