odin-lang / Odin

Odin Programming Language
https://odin-lang.org
BSD 3-Clause "New" or "Revised" License
6.89k stars 606 forks source link

enum + #any_int + $T #1125

Closed awwdev closed 2 years ago

awwdev commented 3 years ago

Odin dev-2021-09:e2f035d6 Windows, Linux

Seems like enum + #any_int + $T don't play together. Example:

Foo :: enum { A }
bar :: proc(#any_int n: int, $T: typeid) {}
bar(Foo.A, f32)

Odin\src\llvm_backend_proc.cpp(6): Assertion Failure: entity->flags & EntityFlag_ProcBodyChecked

It works without the generic:

Foo :: enum { A }
bar :: proc(#any_int n: int) {}
bar(Foo.A) //no generic

It works without the enum:

bar :: proc(#any_int n: int, $T: typeid) {}
bar(int, f32) //no enum
awwdev commented 2 years ago

I will close this Issue because it no longer triggers the compiler assertion but builds+runs fine. Tested with dev-2022-05:d1fc9d30.

gingerBill commented 2 years ago

@awwdev Thank you for closing loads of things!