Odin icon indicating copy to clipboard operation
Odin copied to clipboard

#type proc and global container init - code gen failed

Open awwdev opened this issue 3 years ago • 1 comments

Odin dev-2021-07:ec9667ef OS Windows

Seems like #type proc and global containers don't play together.

Proc :: #type proc();
m: []Proc;
main :: proc()  {
    m = make([]Proc, 123);
}

LLVM CODE GEN FAILED FOR PROCEDURE: main [...]

The following compiles:

//removing #type
m: []proc();
main :: proc()  {
    m = make([]proc(), 123);
}

//moving into local scope
main :: proc()  {
    Proc :: #type proc();
    m: []Proc;
    m = make([]Proc, 123);
}

//non-container
Proc :: #type proc();
m: Proc;
main :: proc()  {
    m = Proc {};
}

awwdev avatar Jul 12 '21 15:07 awwdev

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..

github-actions[bot] avatar Jul 24 '22 21:07 github-actions[bot]

This seems to be fixed. Cannot reproduce in dev-2022-12:1d6f7680.

awwdev avatar Dec 25 '22 17:12 awwdev