Open FourteenBrush opened 5 months ago
I get a compiler panic on the following code:
package something main :: proc() { Ptr :: struct($T: typeid) { ptr: #relative(u16) ^T, } A :: struct {} a := A {} ptr := Ptr(A) { ptr = &a } }
Note that this happens with every backing size of the relative pointer. Compiler output:
something.main lb_emit_conv: src -> dst Not Identical ^A != #relative(u16) ^A Not Identical ^A != #relative(u16) ^A Not Identical 7e0d0b9f4050 != 7e0d4ca0ddd0 Not Identical 7e0d0b9f4050 != 7e0d4ca0ddd0 src/llvm_backend_expr.cpp(2291): Panic: Invalid type conversion: '^A' to '#relative(u16) ^A' for procedure 'something.main'
Odin: dev-2024-03:63d6b4752 OS: Pop!_OS 22.04 LTS, Linux 6.8.0-76060800daily20240311-generic CPU: AMD Ryzen 7 5800H with Radeon Graphics RAM: 13827 MiB Backend: LLVM 14.0.0
This should compile fine?
Simply run above file with odin run something.odin -file
odin run something.odin -file
I assume this is probably not getting fixed due to core:relative being a thing?
Context
I get a compiler panic on the following code:
Note that this happens with every backing size of the relative pointer. Compiler output:
Operating System & Odin Version
Odin: dev-2024-03:63d6b4752 OS: Pop!_OS 22.04 LTS, Linux 6.8.0-76060800daily20240311-generic CPU: AMD Ryzen 7 5800H with Radeon Graphics
RAM: 13827 MiB Backend: LLVM 14.0.0
Expected Behavior
This should compile fine?
Steps to Reproduce
Simply run above file with
odin run something.odin -file