Odin
Odin copied to clipboard
Allow named return values to be uninitialized
Currently, you are not allowed to do this:
Result :: struct {
value: int,
}
f :: proc() -> (result: Result = ---) {
result.value = 44
return
}
This currently produces the following error:
Default parameter must be a constant, 2
Since named return values are literally variables that you can take the address of, etc, it makes sense to be to leave them uninitialized, in a similar manner to normal local variables, like in #1514.
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..