Odin
Odin copied to clipboard
Can't negate non constants in default procedure parameters
Context
- Operating System:
Linux Mint 20 - Kernel 5.4.0-73-generic - Please paste
odin versionoutput:odin version dev-2021-07:f7413ca9
Expected Behavior
Negate a default procedure parameter just like constants are allowed to be negated.
Current Behavior
Works as expected on constants, but doesn't on "non constants".
Steps to Reproduce
TEST :: 0.1;
non_constant: f32 = 0.2;
a :: proc(param1: f32 = -TEST, param2: f32 = -non_constant) {
fmt.println("hi", param1, param2);
}
main :: proc() {
a();
}
Failure Logs
/home/michael/Schreibtisch/experimental/main.odin(17:46) Default parameter must be a constant, 2
/home/michael/Schreibtisch/experimental/main.odin(22:2) Too few arguments for 'a', expected 2 arguments, got 0
This is not a bug but it does require a better error message
okay :+1:
Hello!
I am marking this issue as stale as it has not received any engagement from the community or maintainers 120 days. That does not imply that the issue has no merit! If you feel strongly about this issue
- open a PR referencing and resolving the issue;
- leave a comment on it and discuss ideas how you could contribute towards resolving it;
- leave a comment and describe in detail why this issue is critical for your use case;
- open a new issue with updated details and a plan on resolving the issue.
The motivation for this automation is to help prioritize issues in the backlog and not ignore, reject, or belittle anyone..