You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you say my_func(0) prevents the crash from happening, would that be because the compiler tells you the following, which is what you'd expect without the (0)?
W:/Scratch/scratch.odin(3:12) Error: A procedure type with the #optional_ok tag requires 2 return values, got 0
my_func :: proc() #optional_ok {
^~~~~^
W:/Scratch/scratch.odin(8:2) Error: Too many arguments for 'my_func', expected 0 arguments, got 1
my_func(0)
^~~~~~~~~^
When you say my_func(0) prevents the crash from happening, would that be because the compiler tells you the following, which is what you'd expect without the (0)?
Yes exactly, sorry if it was confusing, it just seems weird that it completely prevented the crash.
Context
Odin: dev-2025-05:30c6fea9e
OS: Windows 10 Professional (version: 22H2), build 19045.5737
CPU: AMD Ryzen 7 7700 8-Core Processor
RAM: 31849 MiB
Backend: LLVM 20.1.0
Expected Behavior
The compiler should display "Error: A procedure type with the #optional_ok tag requires 2 return values, got 0"
Current Behavior
The compiler crashes in check_expr.cpp:8148, in check_call_expr()
Failure Information (for bugs)
Steps to Reproduce
But calling
my_func(0)
will prevent the crash from happeningThe text was updated successfully, but these errors were encountered: