Closed dllouw closed 4 days ago
After correcting the typo (main :: proc }
) and adding a comma after -> T
, I was able to replicate this:
Foo :: struct ($T: typeid) {
bar: proc (x: $T) -> T,
}
main :: proc() {
foo := Foo(typeid) { proc (_: typeid) {} }
// normal access of a member function of the struct instance
foo.bar(int) // this works
// now a typo where we have Foo instead of foo
Foo.bar(int) // this freezes the compiler
}
If I'm understanding it right, this is a duplicate of https://github.com/odin-lang/Odin/issues/3471
Fixed in 52ea63f89c7d7c9ff081ab678f9c206e9775a032
Context
Compiler freezes when calling a function that is a member of a struct type instead of a struct instance.
Operating System & Odin Version: Odin: dev-2024-06:bad4a6237 OS: Ubuntu 24.04 LTS, Linux 6.8.0-35-generic CPU: AMD Ryzen 7 3800X 8-Core Processor RAM: 64217 MiB Backend: LLVM 18.1.3
Expected Behavior
Some type of compiler time error.
Current Behavior
No error, compiler just hangs.
Steps to Reproduce
Tring to compile this will hang the compiler:
Failure Logs
n/a