Skip to content

Declaration order dependent checker error #5961

@FrancisTheCat

Description

@FrancisTheCat

Context

Operating System & Odin Version:

Odin:    dev-2025-11:5e3648b83
OS:      Arch Linux, Linux 6.17.8-arch1-1
CPU:     AMD Ryzen 5 7640U w/ Radeon 760M Graphics
RAM:     19798 MiB
Backend: LLVM 21.1.5

Current Behavior

This is fine:

package test

Foo :: union { Bar, }
Bar :: union { ^Foo, }

This errors, but should not:

package test

Bar :: union { ^Foo, }
Foo :: union { Bar, }
test.odin(4:16) Error: Invalid variant type in union 'Bar'
	Foo :: union { Bar, }
	               ^~^

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions