Odin icon indicating copy to clipboard operation
Odin copied to clipboard

compiler panic on invalid procedure aliasing

Open awwdev opened this issue 3 years ago • 2 comments

Context

Odin: dev-2021-12:eec61c3f The compiler flag check will not produce the panic. You need to use build (or run).

Current Behavior

The following invalid syntax causes a compiler panic:

FOO :: proc() //same outcome with or without the attribute #type 
foo :: FOO {} //invalid syntax (Odin does not have this type of procedure aliasing)
foo()

Odin\src\llvm_backend_general.cpp(2409): Panic: nullptr value for expression from identifier: <your_package_name>.foo (29d1538d140) : FOO @ 29cbffa1b90

Expected Behavior

Instead of panicking, the compiler should report an error message about this invalid syntax. Additionally, the parser alone (invoked by check) should already catch the error, prior to compilation.

awwdev avatar Dec 24 '21 09:12 awwdev

FOO {} //invalid syntax Is actually valid syntax and semantics, it's just defining a nil procedure of FOO type

However, this is a bug in the backend.

gingerBill avatar Jan 03 '22 13:01 gingerBill

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 22:07 github-actions[bot]

Appears to be fixed (tested with version dev-2022-09:98420192), there is no more compiler panic. It reports the following user error instead: Illegal declaration of a constant procedure value

awwdev avatar Sep 17 '22 08:09 awwdev