Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite Loop in compiler when hiding a cyclic dependency with polymorphism #4847

Open
MrMetube opened this issue Feb 15, 2025 · 0 comments
Open

Comments

@MrMetube
Copy link

Context

    Odin:    dev-2025-02:584fdc0d4
    OS:      Windows 11 Professional (version: 24H2), build 26100.3194
    CPU:     12th Gen Intel(R) Core(TM) i5-12600
    RAM:     32540 MiB
    Backend: LLVM 18.1.8

Current Behavior

The compiler enters an infinite loop, when hiding a cyclic type definition inside a polymorphic struct.
It can already detect the cyclic dependency if we do not wrap the CyclicType and just use an alias or the type directly in its own definition.

Reproduction

package repro

Wrapper :: struct($T: typeid) {
    data: T,
}

CyclicType :: struct { 
    it: Wrapper(CyclicType),
}

// Also happens with union
CyclicUnion :: union { 
    f32,
    Wrapper(CyclicUnion),
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant