odin-lang / Odin

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

odin build segfaults on self-referencing union #3803

Closed jist99 closed 4 days ago

jist99 commented 1 week ago

Context

Operating System & Odin Version:

Please paste odin report output:

Odin:    dev-2024-05:7dc1f114b
OS:      macOS Sonoma 14.4.1 (build: 23F79, kernel: 23.4.0)
CPU:     Apple M1
RAM:     16384 MiB
Backend: LLVM 14.0.6

Expected Behavior

When I define a self-referencing union the odin compiler should properly create the union or give an appropriate error.

Current Behavior

The odin compiler segfaults

Failure Information (for bugs)

Steps to Reproduce

  1. Paste the code:
    
    package main

FL_Item :: union($T: typeid) { T, ^FL_Item(T) }

main :: proc() {}


2. run `odin build filename.odin -file`

### Failure Logs

N/A
Kelimion commented 4 days ago

Hits this assert in checker.cpp.

image