Skip to content

Union with elements seen as empty union #162

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

Closed
ThisDevDane opened this issue Dec 10, 2017 · 0 comments
Closed

Union with elements seen as empty union #162

ThisDevDane opened this issue Dec 10, 2017 · 0 comments
Labels

Comments

@ThisDevDane
Copy link
Member

The following code produces the error test.odin(23:5) Invalid use of an empty union 'Element'

import "core:fmt.odin";

Symbol :: struct {
    name: string,
    value: Element,
}

Cons :: struct {
    car, cdr: Element,
}

Element :: union {
    ^Symbol,
    ^Cons,
}

main :: proc() {
    fmt.println("TEST");
}

while this doesnt

import "core:fmt.odin";

Symbol :: struct {
    name: string,
}

Cons :: struct {
    car, cdr: Element,
}

Element :: union {
    ^Symbol,
    ^Cons,
}

main :: proc() {
    fmt.println("TEST");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants